summaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2017-10-19 10:18:41 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2017-10-20 14:21:01 +0200
commitd4210b372ac78c8e85ecc6e2317b76daafba15c9 (patch)
treeabb6a9a89ca5d36c6d6b28621d7604504251d41a /src/main.c
parent9504cfceca4e9ef8b16be748e92fdc20c10750db (diff)
main: Fix for wrong argument passed to cache_release in nft_ctx_free
nft_ctx_free() should not refer to the global 'nft' variable, this will break as soon as the function is moved away from main.c. In order to use the cache reference from passed argument, the latter must not be const. Signed-off-by: Phil Sutter <phil@nwl.cc> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index b59c932a..1b268380 100644
--- a/src/main.c
+++ b/src/main.c
@@ -305,13 +305,13 @@ static struct nft_ctx *nft_ctx_new(uint32_t flags)
return ctx;
}
-static void nft_ctx_free(const struct nft_ctx *ctx)
+static void nft_ctx_free(struct nft_ctx *ctx)
{
if (ctx->nf_sock)
netlink_close_sock(ctx->nf_sock);
iface_cache_release();
- cache_release(&nft->cache);
+ cache_release(&ctx->cache);
xfree(ctx);
nft_exit();
}