From fecb719ec1e1abc665f91d55adaa4951db5c1bed Mon Sep 17 00:00:00 2001 From: Thomas Hindoe Paaboel Andersen Date: Tue, 19 May 2015 23:19:29 +0200 Subject: json: fix a mem leak --- src/test/test-json.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/test') diff --git a/src/test/test-json.c b/src/test/test-json.c index c4b4a222f9..0be69f88e1 100644 --- a/src/test/test-json.c +++ b/src/test/test-json.c @@ -75,7 +75,7 @@ static void test_one(const char *data, ...) { typedef void (*Test)(JsonVariant *); static void test_file(const char *data, Test test) { - JsonVariant *v = NULL; + _cleanup_jsonunref_ JsonVariant *v = NULL; int r = json_parse(data, &v); assert_se(r == 0); @@ -84,8 +84,6 @@ static void test_file(const char *data, Test test) { if (test) test(v); - - json_variant_unref(v); } static void test_1(JsonVariant *v) { -- cgit v1.2.3-54-g00ecf