diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2005-02-10 22:24:53 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2005-02-10 22:24:53 +0000 |
commit | dd8d098feb26dfbd73a0b91a55dc622eeda506ad (patch) | |
tree | 6874f8631f06f8ccdd131ec693f3d4f680a873d3 /lib/libusbhid | |
parent | 21e87f9a6df330145ac9af3aeb225af12c6be537 (diff) |
Fix a realloc() failure bug introduced in previous version.
Found by Andey Matveev.
Diffstat (limited to 'lib/libusbhid')
-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); |