summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2020-07-06 14:05:23 +0200
committerGravatar Nikias Bassen2020-07-06 14:05:23 +0200
commitce1d31fe7766f215fecdf4e2b3919efd1834c581 (patch)
tree8db9e0b541360e6ead3373078026cd885c893b77 /src
parentfbcfbf2cd6af29d05fdb17e129bb8db7a2253bd7 (diff)
downloadlibirecovery-ce1d31fe7766f215fecdf4e2b3919efd1834c581.tar.gz
libirecovery-ce1d31fe7766f215fecdf4e2b3919efd1834c581.tar.bz2
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.
Diffstat (limited to 'src')
-rw-r--r--src/libirecovery.c5
1 files 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);