Free cJSON objects at the end of the test runner (fixes #2)
This commit is contained in:
@@ -492,6 +492,7 @@ int main(void)
|
|||||||
|
|
||||||
if (!cJSON_IsArray(root)) {
|
if (!cJSON_IsArray(root)) {
|
||||||
fprintf(stderr, "Error: %s doesn't contain a JSON array as expected", path);
|
fprintf(stderr, "Error: %s doesn't contain a JSON array as expected", path);
|
||||||
|
cJSON_Delete(root);
|
||||||
free(buf);
|
free(buf);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -544,6 +545,7 @@ int main(void)
|
|||||||
printf(" failed : %d\n", num_failed);
|
printf(" failed : %d\n", num_failed);
|
||||||
printf(" aborted: %d\n", num_aborted);
|
printf(" aborted: %d\n", num_aborted);
|
||||||
|
|
||||||
|
cJSON_Delete(root);
|
||||||
free(buf);
|
free(buf);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user