Skip to content

Commit 456a90a

Browse files
committed
runtime: add missing unlock in sysReserveAlignedSbrk
sysReserveAlignedSbrk locks memlock at entry, but it is not unlocked at one of the return path. Add the missing unlock. Fixes #74339. Change-Id: Ib641bc348aca41494ec410e2c4eb9857f3362484 Reviewed-on: https://go-review.googlesource.com/c/go/+/683295 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com>
1 parent 1cf6386 commit 456a90a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

‎src/runtime/mem_sbrk.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ func sysReserveAlignedSbrk(size, align uintptr) (unsafe.Pointer, uintptr) {
231231
memFree(unsafe.Pointer(end), endLen)
232232
}
233233
memCheck()
234+
unlock(&memlock)
234235
return unsafe.Pointer(pAligned), size
235236
}
236237

0 commit comments

Comments
 (0)