summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2013-11-20 16:47:48 +0100
committerGravatar Martin Szulecki2013-11-20 16:47:48 +0100
commit84982d71abb628ed3a0547fb042ac066d9468154 (patch)
treeaaebc86087122403afeba3f7b4dd9c0df42fd151
parent4aafe03b5a3ca491ff9c75b194ae812f7e4c5224 (diff)
downloadlibirecovery-84982d71abb628ed3a0547fb042ac066d9468154.tar.gz
libirecovery-84982d71abb628ed3a0547fb042ac066d9468154.tar.bz2
Fix memory leaks in irecv_open_with_ecid()
-rw-r--r--src/libirecovery.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libirecovery.c b/src/libirecovery.c
index 0c42162..bbe88aa 100644
--- a/src/libirecovery.c
+++ b/src/libirecovery.c
@@ -803,6 +803,8 @@ irecv_error_t irecv_open_with_ecid(irecv_client_t* pclient, unsigned long long e
error = irecv_usb_set_configuration(client, 1);
if (error != IRECV_E_SUCCESS) {
+ libusb_free_device_list(usb_device_list, 1);
+ irecv_close(client);
return error;
}
@@ -814,11 +816,15 @@ irecv_error_t irecv_open_with_ecid(irecv_client_t* pclient, unsigned long long e
}
if (error != IRECV_E_SUCCESS) {
+ libusb_free_device_list(usb_device_list, 1);
+ irecv_close(client);
return error;
}
*pclient = client;
+ libusb_free_device_list(usb_device_list, 1);
+
return IRECV_E_SUCCESS;
}
}