summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
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) {