summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorGravatar Bastien Nocera2018-07-24 14:28:22 +0200
committerGravatar Bastien Nocera2018-07-24 14:36:27 +0200
commitd7a2e04d2e7880c56116fd35489a7f98755501b7 (patch)
treeb07d9a3c27fefc551e6ec97a9c6a9b233b834311 /tools
parente46d17cadb3dd1259b0ca78dc80fc06fbf10c516 (diff)
downloadlibimobiledevice-d7a2e04d2e7880c56116fd35489a7f98755501b7.tar.gz
libimobiledevice-d7a2e04d2e7880c56116fd35489a7f98755501b7.tar.bz2
idevicepair: Fix possible memleak in option parsing
If some arguments are passed multiple times, don't leak the memory used for the value of the first arguments passed.
Diffstat (limited to 'tools')
-rw-r--r--tools/idevicepair.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/idevicepair.c b/tools/idevicepair.c
index f34369e..b6f0751 100644
--- a/tools/idevicepair.c
+++ b/tools/idevicepair.c
@@ -104,6 +104,8 @@ static void parse_opts(int argc, char **argv)
print_usage(argc, argv);
exit(2);
}
+ if (udid)
+ free(udid);
udid = strdup(optarg);
break;
case 'd':