From eefa59be85b1bbc810cfa8533d219b0fbf0155d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20Walstr=C3=B6m?= Date: Mon, 11 Jun 2018 13:46:06 +0200 Subject: [PATCH] BUG: Do not access cfg when cfg is free --- src/dhcp-helper.c | 2 +- src/misc.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/dhcp-helper.c b/src/dhcp-helper.c index 1e38909..d416af9 100644 --- a/src/dhcp-helper.c +++ b/src/dhcp-helper.c @@ -313,8 +313,8 @@ static void cleanup(struct ev_loop *loop) } } /* UDP socket not necessary to 'restart' */ - conf_free(cfg); cleanup_nftables(cfg); + conf_free(cfg); } static struct ev_loop *init(struct ev_loop *loop, char *fname) diff --git a/src/misc.c b/src/misc.c index 2dcbb3e..3d8d1f9 100644 --- a/src/misc.c +++ b/src/misc.c @@ -167,6 +167,7 @@ int cleanup_nftables(cfg_t *cfg) } if (anybridged) { + syslog2(LOG_DEBUG, "Some interfaces is bridged, remove nftables rules"); if (system("nft delete chain bridge filter " NFT_IN_CHAIN)) syslog2(LOG_ERR, "Failed deleting nftables input rules"); if (system("nft delete chain bridge filter " NFT_FWD_CHAIN))