Skip to content

Commit

Permalink
Merge pull request #63 from yannh/ensure-lock-is-closed
Browse files Browse the repository at this point in the history
close xtables lock on errors before returning
  • Loading branch information
Casey Callendrello authored Jul 24, 2019
2 parents 0c43e9f + 9b41ebc commit 969b135
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions iptables/iptables.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 969b135

Please sign in to comment.