diff options
author | Andrew Beverley <andy@andybev.com> | 2011-04-16 21:08:26 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2011-05-14 10:51:13 +0200 |
commit | af0ed4892ba998e958e6da52cbdcf900fdd391e9 (patch) | |
tree | 064e2cd531e2d3003d75ababdf064325d1810887 /utils/expect_create_userspace.c | |
parent | d2089340ee2f146617ec9cfbf56c29953f79c428 (diff) |
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 <andy@andybev.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'utils/expect_create_userspace.c')
-rw-r--r-- | utils/expect_create_userspace.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/utils/expect_create_userspace.c b/utils/expect_create_userspace.c index 0e910e6..8f55a9f 100644 --- a/utils/expect_create_userspace.c +++ b/utils/expect_create_userspace.c @@ -45,6 +45,7 @@ int main(void) h = nfct_open(CONNTRACK, 0); if (!h) { perror("nfct_open"); + nfct_destroy(master); return -1; } @@ -66,6 +67,7 @@ int main(void) expected = nfct_new(); if (!expected) { perror("nfct_new"); + nfct_destroy(master); exit(EXIT_FAILURE); } @@ -80,6 +82,8 @@ int main(void) mask = nfct_new(); if (!mask) { perror("nfct_new"); + nfct_destroy(master); + nfct_destroy(expected); exit(EXIT_FAILURE); } @@ -98,6 +102,9 @@ int main(void) exp = nfexp_new(); if (!exp) { perror("nfexp_new"); + nfct_destroy(master); + nfct_destroy(expected); + nfct_destroy(mask); exit(EXIT_FAILURE); } |