summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/plistutil.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/plistutil.c b/tools/plistutil.c
index 4c17ac7..6451604 100644
--- a/tools/plistutil.c
+++ b/tools/plistutil.c
@@ -123,8 +123,10 @@ int main(int argc, char *argv[])
123 123
124 // read input file 124 // read input file
125 iplist = fopen(options->in_file, "rb"); 125 iplist = fopen(options->in_file, "rb");
126 if (!iplist) 126 if (!iplist) {
127 free(options);
127 return 1; 128 return 1;
129 }
128 130
129 stat(options->in_file, &filestats); 131 stat(options->in_file, &filestats);
130 plist_entire = (char *) malloc(sizeof(char) * (filestats.st_size + 1)); 132 plist_entire = (char *) malloc(sizeof(char) * (filestats.st_size + 1));
@@ -150,8 +152,10 @@ int main(int argc, char *argv[])
150 if (options->out_file != NULL) 152 if (options->out_file != NULL)
151 { 153 {
152 FILE *oplist = fopen(options->out_file, "wb"); 154 FILE *oplist = fopen(options->out_file, "wb");
153 if (!oplist) 155 if (!oplist) {
156 free(options);
154 return 1; 157 return 1;
158 }
155 fwrite(plist_out, size, sizeof(char), oplist); 159 fwrite(plist_out, size, sizeof(char), oplist);
156 fclose(oplist); 160 fclose(oplist);
157 } 161 }