coreos / go-iptables

Go wrapper around iptables utility
Apache License 2.0
1.14k stars 257 forks source link

close xtables lock on errors before returning #63

Closed yannh closed 5 years ago

yannh commented 5 years ago

In relation to: https://github.com/coreos/go-iptables/issues/61 if the lock file is successfully opened, but there was an error acquiring a lock, runWithOutput exits without closing the file. This patch tries to close the file before returning.

squeed commented 5 years ago

Good catch, thanks! Are there any other places we can leak this fd?

yannh commented 5 years ago

Hi @squeed , thanks! I think so, see https://github.com/coreos/go-iptables/issues/64 !