diff --git a/profilers/cpu.go b/profilers/cpu.go index 85eb79d..ee1d302 100644 --- a/profilers/cpu.go +++ b/profilers/cpu.go @@ -10,9 +10,9 @@ func GetCPUProfiler() func() { if err != nil { panic(err) } + defer f.Close() if err := pprof.StartCPUProfile(f); err != nil { panic(err) } return pprof.StopCPUProfile - }