summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Toso <victortoso@redhat.com>2016-08-03 18:11:43 +0200
committerVictor Toso <victortoso@redhat.com>2016-08-04 17:47:45 +0200
commit908686a6e0ba28937532b13648d21e3426276666 (patch)
treee148227da3414427ddd55858d872c8a3d94f84e9
parenta14a344f07c679c6da0239ec43ae4409700b52d8 (diff)
usbredirhost: fix leak on error
Pointed by coverity: 17. usbredir-0.7.1/usbredirhost/usbredirhost.c:2306: leaked_storage: Returning without freeing "data" leaks the storage that it points to. # 2304| # usbredirhost_bulk_packet_complete(transfer->transfer); # 2305| } # 2306|-> } # 2307| # 2308| static void usbredirhost_iso_packet(void *priv, uint64_t # id, Acked-by: Pavel Grunt <pgrunt@redhat.com>
-rw-r--r--usbredirhost/usbredirhost.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/usbredirhost/usbredirhost.c b/usbredirhost/usbredirhost.c
index 3e80677..db6b066 100644
--- a/usbredirhost/usbredirhost.c
+++ b/usbredirhost/usbredirhost.c
@@ -2280,6 +2280,7 @@ static void usbredirhost_bulk_packet(void *priv, uint64_t id,
transfer, BULK_TIMEOUT);
#else
r = LIBUSB_ERROR_INVALID_PARAM;
+ free(data);
goto error;
#endif
} else {