From 0182ee2beb872356a75fa4883c2760ce9bbf955b Mon Sep 17 00:00:00 2001 From: Francesco Cozzuto Date: Sun, 7 Dec 2025 15:43:26 +0100 Subject: [PATCH] Free cJSON objects at the end of the test runner (fixes #2) --- tests/test.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test.c b/tests/test.c index 256f8a1..c6f9dbe 100644 --- a/tests/test.c +++ b/tests/test.c @@ -492,6 +492,7 @@ int main(void) if (!cJSON_IsArray(root)) { fprintf(stderr, "Error: %s doesn't contain a JSON array as expected", path); + cJSON_Delete(root); free(buf); return -1; } @@ -544,6 +545,7 @@ int main(void) printf(" failed : %d\n", num_failed); printf(" aborted: %d\n", num_aborted); + cJSON_Delete(root); free(buf); return 0; }