Ver código fonte

lib/ur: Plug file descriptor leak in Linux memorySize (#7266)

greatroar 4 anos atrás
pai
commit
f6fac3e949
1 arquivos alterados com 1 adições e 0 exclusões
  1. 1 0
      lib/ur/memsize_linux.go

+ 1 - 0
lib/ur/memsize_linux.go

@@ -18,6 +18,7 @@ func memorySize() int64 {
 	if err != nil {
 		return 0
 	}
+	defer f.Close()
 
 	s := bufio.NewScanner(f)
 	if !s.Scan() {