Skip to content

Commit

Permalink
fix: close procRoot dir (#891)
Browse files Browse the repository at this point in the history
Co-authored-by: guangwu <[email protected]>
  • Loading branch information
simonswine and testwill authored Aug 22, 2024
1 parent b981764 commit db4712f
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 db4712f

Please sign in to comment.