From 9b41ebc206acf61cef08bc330aa3b0a6e9848701 Mon Sep 17 00:00:00 2001 From: Yann Hamon Date: Sun, 14 Jul 2019 12:55:15 +0200 Subject: [PATCH] close xtables lock on errors before returning --- iptables/iptables.go | 1 + 1 file changed, 1 insertion(+) diff --git a/iptables/iptables.go b/iptables/iptables.go index 2ed875b..a685deb 100644 --- a/iptables/iptables.go +++ b/iptables/iptables.go @@ -437,6 +437,7 @@ func (ipt *IPTables) runWithOutput(args []string, stdout io.Writer) error { } ul, err := fmu.tryLock() if err != nil { + syscall.Close(fmu.fd) return err } defer ul.Unlock()