Cosmetic resource leak in test code Coverity ID: #1454314 Signed-off-by: Peter Meerwald-Stadler <pmeerw at pmeerw.net> --- src/tests/json-test.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/tests/json-test.c b/src/tests/json-test.c index 3e956db..0894a30 100644 --- a/src/tests/json-test.c +++ b/src/tests/json-test.c @@ -248,7 +248,11 @@ START_TEST(bad_test) { }; for (i = 0; i < PA_ELEMENTSOF(bad_parse); i++) { - fail_unless(pa_json_parse(bad_parse[i]) == NULL); + pa_json_object *obj; + + fail_unless((obj = pa_json_parse(bad_parse[i])) == NULL); + if (obj) + pa_json_object_free(obj); } } END_TEST -- 2.7.4