Parcourir la source

close xtables lock on errors before returning

Yann Hamon il y a 5 ans
Parent
commit
9b41ebc206
1 fichiers modifiés avec 1 ajouts et 0 suppressions
  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()