From af0ed4892ba998e958e6da52cbdcf900fdd391e9 Mon Sep 17 00:00:00 2001 From: Andrew Beverley Date: Sat, 16 Apr 2011 21:08:26 +0100 Subject: utils: add nfct_destroy() to all examples in utils This patch adds nfct_destroy() to all the examples in the utils folder. Although this may be obvious to some, when I wrote my first code using libnetfilter_conntract, I used the examples but subsequently missed out all the calls to nfct_destroy(). Signed-off-by: Andrew Beverley Signed-off-by: Pablo Neira Ayuso --- utils/expect_create.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'utils/expect_create.c') diff --git a/utils/expect_create.c b/utils/expect_create.c index 912ab8e..cf379e9 100644 --- a/utils/expect_create.c +++ b/utils/expect_create.c @@ -46,6 +46,7 @@ int main(void) h = nfct_open(CONNTRACK, 0); if (!h) { perror("nfct_open"); + nfct_destroy(master); return -1; } @@ -76,6 +77,8 @@ int main(void) mask = nfct_new(); if (!mask) { perror("nfct_new"); + nfct_destroy(master); + nfct_destroy(expected); exit(EXIT_FAILURE); } @@ -94,6 +97,9 @@ int main(void) exp = nfexp_new(); if (!exp) { perror("nfexp_new"); + nfct_destroy(master); + nfct_destroy(expected); + nfct_destroy(mask); exit(EXIT_FAILURE); } -- cgit v1.2.3