commit | d7a2e04d2e7880c56116fd35489a7f98755501b7 | [log] [tgz] |
---|---|---|
author | Bastien Nocera <hadess@hadess.net> | Tue Jul 24 14:28:22 2018 +0200 |
committer | Bastien Nocera <hadess@hadess.net> | Tue Jul 24 14:36:27 2018 +0200 |
tree | b07d9a3c27fefc551e6ec97a9c6a9b233b834311 | |
parent | e46d17cadb3dd1259b0ca78dc80fc06fbf10c516 [diff] |
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.
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 @@ print_usage(argc, argv); exit(2); } + if (udid) + free(udid); udid = strdup(optarg); break; case 'd':