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