From 5e6fa6f8dcc81cab2eadf19a327ae1ec6e033572 Mon Sep 17 00:00:00 2001 From: Eric Fischer Date: Sat, 8 Feb 2014 00:42:28 -0800 Subject: [PATCH] Remember to deallocate the parser --- jsoncat.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/jsoncat.c b/jsoncat.c index 7f2272b..5ebd284 100644 --- a/jsoncat.c +++ b/jsoncat.c @@ -125,6 +125,8 @@ void process_callback(FILE *f, char *fname) { if (jp->error != NULL) { fprintf(stderr, "%s: %d: %s\n", fname, jp->line, jp->error); } + + json_end(jp); } void process_incremental(FILE *f, char *fname) { @@ -142,6 +144,8 @@ void process_incremental(FILE *f, char *fname) { if (jp->error != NULL) { fprintf(stderr, "%s: %d: %s\n", fname, jp->line, jp->error); } + + json_end(jp); } void process_tree(FILE *f, char *fname) { @@ -162,6 +166,8 @@ void process_tree(FILE *f, char *fname) { json_free(j); printf("\n"); } + + json_end(jp); } int main(int argc, char **argv) {