From ff5e64227377a8d33e2ff0be08c1b4cc4a8409fd Mon Sep 17 00:00:00 2001 From: Jan-Piet Mens Date: Wed, 16 Sep 2015 09:01:35 +0200 Subject: [PATCH] free after using slurped file --- util.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/util.c b/util.c index 82e9587..3983f8d 100644 --- a/util.c +++ b/util.c @@ -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); }