aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKevin Lo <kevlo@FreeBSD.org>2010-12-28 02:43:28 +0000
committerKevin Lo <kevlo@FreeBSD.org>2010-12-28 02:43:28 +0000
commitbc55aaaa6676d8ad033d36c04fabcf0b83ef4b52 (patch)
tree18c963e67e999c2364b9566ce387b72d8f13b39f /lib
parentbe35e6d5707244fb52874d70e4c24f9b4aafe50f (diff)
Notes
Diffstat (limited to 'lib')
-rw-r--r--lib/libusb/libusb20_compat01.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/libusb/libusb20_compat01.c b/lib/libusb/libusb20_compat01.c
index aaafb02cb11e..4124ef6fbcd5 100644
--- a/lib/libusb/libusb20_compat01.c
+++ b/lib/libusb/libusb20_compat01.c
@@ -457,6 +457,11 @@ usb_parse_configuration(struct usb_config_descriptor *config,
/* allocate memory for our configuration */
ptr = malloc(a + b + c + d);
+ if (ptr == NULL) {
+ /* free config structure */
+ free(ps.a.currcfg);
+ return (-1);
+ }
/* "currifcw" must be first, hence this pointer is freed */
ps.b.currifcw = (void *)(ptr);