Explorar o código

close xtables lock on errors before returning

Yann Hamon %!s(int64=5) %!d(string=hai) anos
pai
achega
9b41ebc206
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      iptables/iptables.go

+ 1 - 0
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()