free after using slurped file

This commit is contained in:
Jan-Piet Mens
2015-09-16 09:01:35 +02:00
parent a6c3db8cee
commit ff5e642273
+2
View File
@@ -165,10 +165,12 @@ int json_copy_from_file(JsonNode *obj, char *filename)
if ((node = json_decode(js_string)) == NULL) {
fprintf(stderr, "json_copy_from_file can't decode JSON from %s\n", filename);
free(js_string);
return (FALSE);
}
json_copy_to_object(obj, node, FALSE);
json_delete(node);
free(js_string);
return (TRUE);
}