summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2019-02-16 21:42:53 +0100
committerGravatar Nikias Bassen2019-02-16 21:42:53 +0100
commit0584aa90c93ff6ce46927b8d67887cb987ab9545 (patch)
treec25d01abfda420d5c02733f9ab0c74ae67378f4d /tools
parentcccc965ff1a87ac70d9fe4b10f8cad28c3de2874 (diff)
downloadlibimobiledevice-0584aa90c93ff6ce46927b8d67887cb987ab9545.tar.gz
libimobiledevice-0584aa90c93ff6ce46927b8d67887cb987ab9545.tar.bz2
idevicepair: Fix udid being freed before printing error message containing udid
Diffstat (limited to 'tools')
-rw-r--r--tools/idevicepair.c5
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) {