فهرست منبع

Merge pull request #63 from yannh/ensure-lock-is-closed

close xtables lock on errors before returning
Casey Callendrello 5 سال پیش
والد
کامیت
969b135e94
1فایلهای تغییر یافته به همراه1 افزوده شده و 0 حذف شده
  1. 1 0
      iptables/iptables.go

+ 1 - 0
iptables/iptables.go

@@ -425,6 +425,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()