Skip to content

Commit

Permalink
fix: close procRoot dir (#6906)
Browse files Browse the repository at this point in the history
Co-authored-by: Paulin Todev <[email protected]>
  • Loading branch information
testwill and ptodev authored Sep 2, 2024
1 parent d87f8af commit c2a37b7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions internal/component/pyroscope/java/asprof/asprof.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ func (p *Profiler) CopyLib(dist *Distribution, pid int) error {
if err != nil {
return fmt.Errorf("failed to open proc root %s: %w", procRoot, err)
}
defer procRootFile.Close()
dstLibPath := strings.TrimPrefix(dist.LibPath(), "/")
dstLauncherPath := strings.TrimPrefix(dist.LauncherPath(), "/")
if err = writeFile(procRootFile, dstLibPath, libData, false); err != nil {
Expand Down

0 comments on commit c2a37b7

Please sign in to comment.