diff options
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/plistutil.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/tools/plistutil.c b/tools/plistutil.c index fc0d7c0..4c17ac7 100644 --- a/tools/plistutil.c +++ b/tools/plistutil.c | |||
| @@ -112,13 +112,12 @@ int main(int argc, char *argv[]) | |||
| 112 | uint32_t size = 0; | 112 | uint32_t size = 0; |
| 113 | int read_size = 0; | 113 | int read_size = 0; |
| 114 | char *plist_entire = NULL; | 114 | char *plist_entire = NULL; |
| 115 | struct stat *filestats = (struct stat *) malloc(sizeof(struct stat)); | 115 | struct stat filestats; |
| 116 | options_t *options = parse_arguments(argc, argv); | 116 | options_t *options = parse_arguments(argc, argv); |
| 117 | 117 | ||
| 118 | if (!options) | 118 | if (!options) |
| 119 | { | 119 | { |
| 120 | print_usage(argc, argv); | 120 | print_usage(argc, argv); |
| 121 | free(filestats); | ||
| 122 | return 0; | 121 | return 0; |
| 123 | } | 122 | } |
| 124 | 123 | ||
| @@ -127,9 +126,9 @@ int main(int argc, char *argv[]) | |||
| 127 | if (!iplist) | 126 | if (!iplist) |
| 128 | return 1; | 127 | return 1; |
| 129 | 128 | ||
| 130 | stat(options->in_file, filestats); | 129 | stat(options->in_file, &filestats); |
| 131 | plist_entire = (char *) malloc(sizeof(char) * (filestats->st_size + 1)); | 130 | plist_entire = (char *) malloc(sizeof(char) * (filestats.st_size + 1)); |
| 132 | read_size = fread(plist_entire, sizeof(char), filestats->st_size, iplist); | 131 | read_size = fread(plist_entire, sizeof(char), filestats.st_size, iplist); |
| 133 | fclose(iplist); | 132 | fclose(iplist); |
| 134 | 133 | ||
| 135 | // convert from binary to xml or vice-versa | 134 | // convert from binary to xml or vice-versa |
| @@ -145,7 +144,6 @@ int main(int argc, char *argv[]) | |||
| 145 | } | 144 | } |
| 146 | plist_free(root_node); | 145 | plist_free(root_node); |
| 147 | free(plist_entire); | 146 | free(plist_entire); |
| 148 | free(filestats); | ||
| 149 | 147 | ||
| 150 | if (plist_out) | 148 | if (plist_out) |
| 151 | { | 149 | { |
