From 4de6a4e001163d43e00522016f50396c329e407d Mon Sep 17 00:00:00 2001 From: Matt Layher Date: Sat, 9 Jun 2018 09:12:55 -0400 Subject: [PATCH] Close netlink connection after flushing commands (#1) --- nftables.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nftables.go b/nftables.go index 82bf204..276510c 100644 --- a/nftables.go +++ b/nftables.go @@ -264,6 +264,8 @@ func (cc *Conn) Flush() error { return err } + defer conn.Close() + if _, err := conn.SendMessages(batch(cc.messages)); err != nil { return fmt.Errorf("SendMessages: %v", err) }