]> xenbits.xensource.com Git - seabios.git/commitdiff
usb: Minor - properly free memory on get_device_config() error path
authorKevin O'Connor <kevin@koconnor.net>
Thu, 1 Jan 2015 18:47:28 +0000 (13:47 -0500)
committerKevin O'Connor <kevin@koconnor.net>
Wed, 7 Jan 2015 15:13:46 +0000 (10:13 -0500)
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
src/hw/usb.c

index 46e17df7729896d44669e8eee8dbcd36330a2aa7..1b4ea8beda5d9ab206f06c6e1c38d6dea414f18c 100644 (file)
@@ -253,8 +253,10 @@ get_device_config(struct usb_pipe *pipe)
         return NULL;
     req.wLength = cfg.wTotalLength;
     ret = usb_send_default_control(pipe, &req, config);
-    if (ret)
+    if (ret) {
+        free(config);
         return NULL;
+    }
     //hexdump(config, cfg.wTotalLength);
     return config;
 }