summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Haszlakiewicz <erh+git@nimenees.com>2020-06-22 01:12:03 +0000
committerEric Haszlakiewicz <erh+git@nimenees.com>2020-06-22 01:12:03 +0000
commit7a72805e344509170c1665522c4f82a96d050ea7 (patch)
treecb7c53f1c42cf99ede145a5a7517544ac39b3aed
parent7d3c2d9fad992293c1001e86789b866a5a168e4d (diff)
downloadjson-c-7a72805e344509170c1665522c4f82a96d050ea7.tar.gz
Fix memory leak in test_parse's single_incremental_parse().
-rw-r--r--tests/test_parse.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/test_parse.c b/tests/test_parse.c
index da82b51..c2a271c 100644
--- a/tests/test_parse.c
+++ b/tests/test_parse.c
@@ -72,6 +72,10 @@ static void single_incremental_parse(const char *test_string, int clear_serializ
chunksize, all_at_once_str, new_str);
}
json_tokener_free(tok);
+ if (all_at_once_obj)
+ json_object_put(all_at_once_obj);
+ if (new_obj)
+ json_object_put(new_obj);
}
static void single_basic_parse(const char *test_string, int clear_serializer)