Skip to content

Commit ee52490

Browse files
committed
fix: closing file after reading udp stats
1 parent 566cb63 commit ee52490

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

container/libcontainer/handler.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -700,6 +700,8 @@ func udpStatsFromProc(rootFs string, pid int, file string) (info.UdpStat, error)
700700
return udpStats, fmt.Errorf("failure opening %s: %v", udpStatsFile, err)
701701
}
702702

703+
defer r.Close()
704+
703705
udpStats, err = scanUDPStats(r)
704706
if err != nil {
705707
return udpStats, fmt.Errorf("couldn't read udp stats: %v", err)

0 commit comments

Comments
 (0)