diff options
author | Nikias Bassen | 2019-02-16 21:42:53 +0100 |
---|---|---|
committer | Nikias Bassen | 2019-02-16 21:42:53 +0100 |
commit | 0584aa90c93ff6ce46927b8d67887cb987ab9545 (patch) | |
tree | c25d01abfda420d5c02733f9ab0c74ae67378f4d | |
parent | cccc965ff1a87ac70d9fe4b10f8cad28c3de2874 (diff) | |
download | libimobiledevice-0584aa90c93ff6ce46927b8d67887cb987ab9545.tar.gz libimobiledevice-0584aa90c93ff6ce46927b8d67887cb987ab9545.tar.bz2 |
idevicepair: Fix udid being freed before printing error message containing udid
-rw-r--r-- | tools/idevicepair.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/idevicepair.c b/tools/idevicepair.c index 77c46b7..be1f373 100644 --- a/tools/idevicepair.c +++ b/tools/idevicepair.c @@ -192,12 +192,13 @@ int main(int argc, char **argv) if (udid) { ret = idevice_new(&device, udid); - free(udid); - udid = NULL; if (ret != IDEVICE_E_SUCCESS) { printf("No device found with udid %s, is it plugged in?\n", udid); + free(udid); return EXIT_FAILURE; } + free(udid); + udid = NULL; } else { ret = idevice_new(&device, NULL); if (ret != IDEVICE_E_SUCCESS) { |