diff options
author | 2005-02-10 22:24:52 +0000 | |
---|---|---|
committer | 2005-02-10 22:24:52 +0000 | |
commit | fcfd87e420b5913e6f8a2aad736352026e851f28 (patch) | |
tree | 3feea3c7820ff7550fc69ae4f7403589ed20df5e /lib/libusbhid/usage.c | |
parent | Also add DPD. (diff) | |
download | wireguard-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.c | 4 |
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); |