Skip to content

Commit 7bf2b85

Browse files
authored
fix: close procRoot dir
1 parent 2d14260 commit 7bf2b85

File tree

1 file changed

+1
-0
lines changed
  • internal/component/pyroscope/java/asprof

1 file changed

+1
-0
lines changed

internal/component/pyroscope/java/asprof/asprof.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ func (p *Profiler) CopyLib(dist *Distribution, pid int) error {
115115
if err != nil {
116116
return fmt.Errorf("failed to open proc root %s: %w", procRoot, err)
117117
}
118+
defer procRootFile.Close()
118119
dstLibPath := strings.TrimPrefix(dist.LibPath(), "/")
119120
dstLauncherPath := strings.TrimPrefix(dist.LauncherPath(), "/")
120121
if err = writeFile(procRootFile, dstLibPath, libData, false); err != nil {

0 commit comments

Comments
 (0)