summaryrefslogtreecommitdiffstats
path: root/src/libirecovery.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libirecovery.c')
-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 }