]> xenbits.xensource.com Git - seabios.git/commitdiff
Free USB MSC pipes on error.
authorKevin O'Connor <kevin@koconnor.net>
Mon, 20 Feb 2012 07:59:36 +0000 (02:59 -0500)
committerKevin O'Connor <kevin@koconnor.net>
Mon, 20 Feb 2012 07:59:36 +0000 (02:59 -0500)
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
src/usb-msc.c

index ef9f4408f3b85c7f857deacc0ea272f01e644f51..06779b3b0b042bf2e5f3755cea2fb2d95f71ca4e 100644 (file)
@@ -169,6 +169,10 @@ usb_msc_init(struct usb_pipe *pipe
     return 0;
 fail:
     dprintf(1, "Unable to configure USB MSC device.\n");
-    free(udrive_g);
+    if (udrive_g) {
+        free_pipe(udrive_g->bulkin);
+        free_pipe(udrive_g->bulkout);
+        free(udrive_g);
+    }
     return -1;
 }