diff options
author | Bastien Nocera | 2018-07-24 14:28:22 +0200 |
---|---|---|
committer | Bastien Nocera | 2018-07-24 14:36:27 +0200 |
commit | d7a2e04d2e7880c56116fd35489a7f98755501b7 (patch) | |
tree | b07d9a3c27fefc551e6ec97a9c6a9b233b834311 /tools | |
parent | e46d17cadb3dd1259b0ca78dc80fc06fbf10c516 (diff) | |
download | libimobiledevice-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.c | 2 |
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': |