summaryrefslogtreecommitdiffstats
path: root/lib/libusbhid/usage.c
diff options
context:
space:
mode:
authormatthieu <matthieu@openbsd.org>2005-02-10 22:24:52 +0000
committermatthieu <matthieu@openbsd.org>2005-02-10 22:24:52 +0000
commitfcfd87e420b5913e6f8a2aad736352026e851f28 (patch)
tree3feea3c7820ff7550fc69ae4f7403589ed20df5e /lib/libusbhid/usage.c
parentAlso add DPD. (diff)
downloadwireguard-openbsd-fcfd87e420b5913e6f8a2aad736352026e851f28.tar.xz
wireguard-openbsd-fcfd87e420b5913e6f8a2aad736352026e851f28.zip
Fix a realloc() failure bug introduced in previous version.
Found by Andey Matveev.
Diffstat (limited to 'lib/libusbhid/usage.c')
-rw-r--r--lib/libusbhid/usage.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libusbhid/usage.c b/lib/libusbhid/usage.c
index 346f60aa9a1..eea8df4e9eb 100644
--- a/lib/libusbhid/usage.c
+++ b/lib/libusbhid/usage.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: usage.c,v 1.6 2004/06/04 00:47:32 deraadt Exp $ */
+/* $OpenBSD: usage.c,v 1.7 2005/02/10 22:24:52 matthieu Exp $ */
/* $NetBSD: usage.c,v 1.1 2001/12/28 17:45:27 augustss Exp $ */
/*
@@ -128,7 +128,7 @@ hid_start(const char *hidname)
len = curpage->pagesizemax + 10;
new = realloc(curpage->page_contents,
len * sizeof (struct usage_in_page));
- if (!curpage->page_contents) {
+ if (!new) {
free(curpage->page_contents);
curpage->page_contents = NULL;
free(n);