From 5e1c2fa23b904ecd90a6ea4ef9876a907edfa249 Mon Sep 17 00:00:00 2001 From: Toshi Piazza Date: Wed, 22 Feb 2017 02:53:45 -0500 Subject: [PATCH] Fixes memory leak --- net/net_linux.go | 1 + 1 file changed, 1 insertion(+) diff --git a/net/net_linux.go b/net/net_linux.go index 17b9dc8..58c0729 100644 --- a/net/net_linux.go +++ b/net/net_linux.go @@ -407,6 +407,7 @@ func getProcInodes(root string, pid int32, max int) (map[string][]inodeMap, erro if err != nil { return ret, nil } + defer f.Close() files, err := f.Readdir(max) if err != nil { return ret, nil