[libnftables PATCH 2/6] test: fix memleak in XML testing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ensure the tree is freed when done.

Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero.glez@xxxxxxxxx>
---
 tests/nft-parsing-test.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/nft-parsing-test.c b/tests/nft-parsing-test.c
index 70028a0..5eaaa1e 100644
--- a/tests/nft-parsing-test.c
+++ b/tests/nft-parsing-test.c
@@ -335,9 +335,11 @@ static int test_xml(const char *filename)
 		}
 	}
 
+	mxmlDelete(tree);
 	return ret;
 
 failparsing:
+	mxmlDelete(tree);
 	printf("parsing %s: ", filename);
 	printf("\033[31mFAILED\e[0m (%s)\n", strerror(errno));
 	return -1;

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux