From d4210b372ac78c8e85ecc6e2317b76daafba15c9 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Thu, 19 Oct 2017 10:18:41 +0200 Subject: 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 Signed-off-by: Pablo Neira Ayuso --- src/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') 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(); } -- cgit v1.2.3