diff options
author | Martin Szulecki | 2009-04-24 17:01:23 +0200 |
---|---|---|
committer | Jonathan Beck | 2009-04-27 19:35:48 +0200 |
commit | ae1478e2761273f18a7736427c8a88782015bd03 (patch) | |
tree | 786bacb0da3f24739bbef776bee0333c5edb6d29 /plutil | |
parent | 6f7a0ffe801380c83af1855138f856fc4efeef56 (diff) | |
download | libplist-ae1478e2761273f18a7736427c8a88782015bd03.tar.gz libplist-ae1478e2761273f18a7736427c8a88782015bd03.tar.bz2 |
Plug a few memory leaks in plutil
Diffstat (limited to 'plutil')
-rw-r--r-- | plutil/plutil.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/plutil/plutil.c b/plutil/plutil.c index 37d83df..8c2245c 100644 --- a/plutil/plutil.c +++ b/plutil/plutil.c @@ -40,6 +40,7 @@ int main(int argc, char *argv[]) if (!options) { print_usage(); + free(filestats); return 0; } //read input file @@ -62,6 +63,9 @@ int main(int argc, char *argv[]) plist_from_xml(plist_entire, filestats->st_size, &root_node); plist_to_bin(root_node, &plist_out, &size); } + plist_free(root_node); + free(plist_entire); + free(filestats); if (plist_out) { if (options->out_file != NULL) { @@ -74,8 +78,12 @@ int main(int argc, char *argv[]) //if no output file specified, write to stdout else fwrite(plist_out, size, sizeof(char), stdout); + + free(plist_out); } else printf("ERROR\n"); + + free(options); return 0; } |