From cd854b5bc28cddbac603a36ad07b3566dc6e1333 Mon Sep 17 00:00:00 2001 From: Petri Lehtinen Date: Fri, 25 Feb 2011 22:24:12 +0200 Subject: [PATCH] tests: Add missing json_decref() calls to suites/api/test_unpack.c --- test/suites/api/test_unpack.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/suites/api/test_unpack.c b/test/suites/api/test_unpack.c index b7935a8..cfc68ea 100644 --- a/test/suites/api/test_unpack.c +++ b/test/suites/api/test_unpack.c @@ -134,6 +134,7 @@ int main() if(!json_unpack_ex(NULL, &error, 0, "[i]")) fail("json_unpack succeeded with NULL root"); check_error("NULL root value", "", -1, -1, 0); + json_decref(j); /* mismatched open/close array/object */ j = json_pack("[]"); @@ -167,11 +168,13 @@ int main() if(!json_unpack_ex(j, &error, 0, "[i]a", &i1)) fail("json_unpack failed to catch garbage after format string"); check_error("Garbage after format string", "", 1, 4, 4); + json_decref(j); j = json_integer(12345); if(!json_unpack_ex(j, &error, 0, "ia", &i1)) fail("json_unpack failed to catch garbage after format string"); check_error("Garbage after format string", "", 1, 2, 2); + json_decref(j); /* NULL format string */ j = json_pack("[]"); -- 2.1.4