summaryrefslogtreecommitdiffstats
path: root/tools/idevicename.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/idevicename.c')
-rw-r--r--tools/idevicename.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/tools/idevicename.c b/tools/idevicename.c
index a87872b..97bf2d4 100644
--- a/tools/idevicename.c
+++ b/tools/idevicename.c
@@ -66,7 +66,7 @@ int main(int argc, char** argv)
66 { NULL, 0, NULL, 0} 66 { NULL, 0, NULL, 0}
67 }; 67 };
68 int res = -1; 68 int res = -1;
69 char* udid = NULL; 69 const char* udid = NULL;
70 int use_network = 0; 70 int use_network = 0;
71 71
72#ifndef WIN32 72#ifndef WIN32
@@ -81,8 +81,7 @@ int main(int argc, char** argv)
81 print_usage(); 81 print_usage();
82 exit(2); 82 exit(2);
83 } 83 }
84 free(udid); 84 udid = optarg;
85 udid = strdup(optarg);
86 break; 85 break;
87 case 'n': 86 case 'n':
88 use_network = 1; 87 use_network = 1;
@@ -153,9 +152,5 @@ int main(int argc, char** argv)
153 lockdownd_client_free(lockdown); 152 lockdownd_client_free(lockdown);
154 idevice_free(device); 153 idevice_free(device);
155 154
156 if (udid) {
157 free(udid);
158 }
159
160 return res; 155 return res;
161} 156}