Fix a few memory leaks in tests

No changes to the actual library code.
This commit is contained in:
Petri Lehtinen 2010-06-10 21:15:43 +03:00
parent 978a47e2c5
commit 1a090bbcd3

View File

@ -20,11 +20,13 @@ int main()
result = json_dumps(json, 0); result = json_dumps(json, 0);
if(!result || strcmp(result, "{}")) if(!result || strcmp(result, "{}"))
fail("json_dumps failed"); fail("json_dumps failed");
free(result);
json_object_set_new(json, "foo", json_integer(5)); json_object_set_new(json, "foo", json_integer(5));
result = json_dumps(json, 0); result = json_dumps(json, 0);
if(!result || strcmp(result, "{\"foo\": 5}")) if(!result || strcmp(result, "{\"foo\": 5}"))
fail("json_dumps failed"); fail("json_dumps failed");
free(result);
json_decref(json); json_decref(json);