From ce1d31fe7766f215fecdf4e2b3919efd1834c581 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Mon, 6 Jul 2020 14:05:23 +0200 Subject: linux/libusb: Break out of loop when device is found in irecv_open_with_ecid() and make sure device list is always free'd properly Thanks to tihmstar for pointing this out. --- src/libirecovery.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/libirecovery.c b/src/libirecovery.c index db1b118..d36234f 100644 --- a/src/libirecovery.c +++ b/src/libirecovery.c @@ -1405,13 +1405,12 @@ IRECV_API irecv_error_t irecv_open_with_ecid(irecv_client_t* pclient, unsigned l } *pclient = client; - - libusb_free_device_list(usb_device_list, 1); - ret = IRECV_E_SUCCESS; + break; } } } + libusb_free_device_list(usb_device_list, 1); #endif #else ret = mobiledevice_connect(pclient, ecid); -- cgit v1.1-32-gdbae