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
803 803
804 error = irecv_usb_set_configuration(client, 1); 804 error = irecv_usb_set_configuration(client, 1);
805 if (error != IRECV_E_SUCCESS) { 805 if (error != IRECV_E_SUCCESS) {
806 libusb_free_device_list(usb_device_list, 1);
807 irecv_close(client);
806 return error; 808 return error;
807 } 809 }
808 810
@@ -814,11 +816,15 @@ irecv_error_t irecv_open_with_ecid(irecv_client_t* pclient, unsigned long long e
814 } 816 }
815 817
816 if (error != IRECV_E_SUCCESS) { 818 if (error != IRECV_E_SUCCESS) {
819 libusb_free_device_list(usb_device_list, 1);
820 irecv_close(client);
817 return error; 821 return error;
818 } 822 }
819 823
820 *pclient = client; 824 *pclient = client;
821 825
826 libusb_free_device_list(usb_device_list, 1);
827
822 return IRECV_E_SUCCESS; 828 return IRECV_E_SUCCESS;
823 } 829 }
824 } 830 }