From daa14845ab23e0e32f337f055b2967fa08380ca3 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sun, 22 Jul 2018 23:07:23 +0200 Subject: [PATCH] netconfig: plug fd leak by closing the netlink handle fixes #4 --- internal/netconfig/netconfig.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/netconfig/netconfig.go b/internal/netconfig/netconfig.go index 02b74da..01b653d 100644 --- a/internal/netconfig/netconfig.go +++ b/internal/netconfig/netconfig.go @@ -94,6 +94,7 @@ func applyDhcp4(dir string) error { if err != nil { return fmt.Errorf("netlink.NewHandle: %v", err) } + defer h.Delete() if err := h.AddrReplace(link, addr); err != nil { return fmt.Errorf("AddrReplace(%v): %v", addr, err) }