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/conntrack_master.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'utils/conntrack_master.c') diff --git a/utils/conntrack_master.c b/utils/conntrack_master.c index d08219a..a7c7bca 100644 --- a/utils/conntrack_master.c +++ b/utils/conntrack_master.c @@ -36,6 +36,7 @@ int main(void) h = nfct_open(CONNTRACK, 0); if (!h) { perror("nfct_open"); + nfct_destroy(ct); return -1; } @@ -47,6 +48,8 @@ int main(void) else printf("(OK)\n"); + nfct_destroy(ct); + if (ret == -1) exit(EXIT_FAILURE); @@ -91,5 +94,7 @@ int main(void) nfct_close(h); + nfct_destroy(expected); + ret == -1 ? exit(EXIT_FAILURE) : exit(EXIT_SUCCESS); } -- cgit v1.2.3