diff options
| author | Russ Cox <rsc@golang.org> | 2014-10-03 15:33:29 -0400 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2014-10-03 15:33:29 -0400 |
| commit | 13da3608453f7d50c0c810d5a0df79691bca8b64 (patch) | |
| tree | b0a7d7bc0041d478e3e5e2f45a54c7582414d67f /src/runtime/proc.go | |
| parent | 0120f8378d4de043471fc948fca765abd51a9f4c (diff) | |
| download | go-13da3608453f7d50c0c810d5a0df79691bca8b64.tar.xz | |
runtime: clear sg.selectdone before saving in SudoG cache
Removes another dangling pointer that might
cause a memory leak in 1.4 or crash the GC in 1.5.
LGTM=rlh
R=golang-codereviews
CC=golang-codereviews, iant, khr, r, rlh
https://golang.org/cl/150520043
Diffstat (limited to 'src/runtime/proc.go')
| -rw-r--r-- | src/runtime/proc.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/runtime/proc.go b/src/runtime/proc.go index 76e3ff8851..5b8c7d8ae9 100644 --- a/src/runtime/proc.go +++ b/src/runtime/proc.go @@ -174,6 +174,9 @@ func releaseSudog(s *sudog) { if s.elem != nil { gothrow("runtime: sudog with non-nil elem") } + if s.selectdone != nil { + gothrow("runtime: sudog with non-nil selectdone") + } gp := getg() if gp.param != nil { gothrow("runtime: releaseSudog with non-nil gp.param") |
