From 2df345744af311bdf9b7e0a127fa34a6fb1aac3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Neira=20Ayuso?= Date: Wed, 14 Aug 2013 12:19:31 +0200 Subject: tests: fix memory leaks in jansson test Fixed a string leak and a jansson leak. Signed-off-by: Alvaro Neira Ayuso Signed-off-by: Pablo Neira Ayuso --- tests/nft-parsing-test.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'tests/nft-parsing-test.c') diff --git a/tests/nft-parsing-test.c b/tests/nft-parsing-test.c index 57dc6a5..9e457e8 100644 --- a/tests/nft-parsing-test.c +++ b/tests/nft-parsing-test.c @@ -191,13 +191,15 @@ static int test_json(const char *filename) } } - free(root); + free(json); + json_decref(root); return ret; failparsing: printf("parsing %s: ", filename); printf("\033[31mFAILED\e[0m (%s)\n", strerror(errno)); - free(root); + free(json); + json_decref(root); return -1; #else errno = EOPNOTSUPP; -- cgit v1.2.3