From a1c0011273fc83ec1b509a9d930bca5e278e1e2c Mon Sep 17 00:00:00 2001 From: Stanislav Chzhen Date: Wed, 21 Aug 2024 21:53:01 +0300 Subject: [PATCH] dnsforward: imp code --- internal/dnsforward/ipset.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/dnsforward/ipset.go b/internal/dnsforward/ipset.go index fecb27e6..dcc55e1d 100644 --- a/internal/dnsforward/ipset.go +++ b/internal/dnsforward/ipset.go @@ -56,9 +56,10 @@ func newIpsetHandler( return h, nil } -// close closes the Linux Netfilter connections. +// close closes the Linux Netfilter connections. close can be called on a nil +// handler. func (h *ipsetHandler) close() (err error) { - if h.ipsetMgr != nil { + if h != nil && h.ipsetMgr != nil { return h.ipsetMgr.Close() }