summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2014-10-02 00:48:43 +0200
committerGravatar Martin Szulecki2014-10-02 00:48:43 +0200
commitcdc67e5a997d08158bcb24d51ca991838106bc7e (patch)
tree147ca386e1c36cf0d2c1161d5475755903c5ed6a
parentec1e5190b4a2f9b56500fee0bcd747cedac1426b (diff)
downloadlibirecovery-cdc67e5a997d08158bcb24d51ca991838106bc7e.tar.gz
libirecovery-cdc67e5a997d08158bcb24d51ca991838106bc7e.tar.bz2
Don't call libusb_exit() in irecv_open_with_ecid() on error
The helper might be used multiple times and the library should not cause deinitialization of libusb before the user calls irecv_exit().
-rw-r--r--src/libirecovery.c2
-rw-r--r--tools/irecovery.c1
2 files changed, 1 insertions, 2 deletions
diff --git a/src/libirecovery.c b/src/libirecovery.c
index 83ceefd..99143cb 100644
--- a/src/libirecovery.c
+++ b/src/libirecovery.c
@@ -767,7 +767,6 @@ irecv_error_t irecv_open_with_ecid(irecv_client_t* pclient, unsigned long long e
767 continue; 767 continue;
768 } 768 }
769 libusb_free_device_list(usb_device_list, 1); 769 libusb_free_device_list(usb_device_list, 1);
770 libusb_exit(libirecovery_context);
771 return IRECV_E_UNABLE_TO_CONNECT; 770 return IRECV_E_UNABLE_TO_CONNECT;
772 } 771 }
773 772
@@ -775,7 +774,6 @@ irecv_error_t irecv_open_with_ecid(irecv_client_t* pclient, unsigned long long e
775 if (client == NULL) { 774 if (client == NULL) {
776 libusb_free_device_list(usb_device_list, 1); 775 libusb_free_device_list(usb_device_list, 1);
777 libusb_close(usb_handle); 776 libusb_close(usb_handle);
778 libusb_exit(libirecovery_context);
779 return IRECV_E_OUT_OF_MEMORY; 777 return IRECV_E_OUT_OF_MEMORY;
780 } 778 }
781 779
diff --git a/tools/irecovery.c b/tools/irecovery.c
index 9c153d8..1b1386a 100644
--- a/tools/irecovery.c
+++ b/tools/irecovery.c
@@ -518,6 +518,7 @@ int main(int argc, char* argv[]) {
518 } 518 }
519 519
520 irecv_close(client); 520 irecv_close(client);
521 irecv_exit();
521 522
522 return 0; 523 return 0;
523} 524}