Skip to content

Commit

Permalink
call munmap when failed to check stat segment version (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
xcxinng authored Sep 8, 2022
1 parent db6a7f3 commit 822f517
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions adapter/statsclient/statsclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,9 @@ func (sc *StatsClient) connect() (ss statSegment, err error) {
case 2:
ss = newStatSegmentV2(sc.headerData, size)
default:
if err = syscall.Munmap(sc.headerData); err != nil {
Log.Debugf("unmapping shared memory failed: %v", err)
}
return nil, fmt.Errorf("stat segment version is not supported: %v (min: %v, max: %v)",
version, minVersion, maxVersion)
}
Expand Down

0 comments on commit 822f517

Please sign in to comment.