From: Brad Fitzpatrick Date: Thu, 28 Apr 2016 20:16:46 +0000 (-0500) Subject: os/exec: fix variable shadow, don't leak goroutine X-Git-Tag: go1.7beta1~425 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=1b591dfb1f071d978448966e979e40b1f265c1a5;p=gostls13.git os/exec: fix variable shadow, don't leak goroutine Goroutine leak checking is still too tedious, so untested. See #6705 which is my fault for forgetting to mail out. Change-Id: I899fb311c9d4229ff1dbd3f54fe307805e17efee Reviewed-on: https://go-review.googlesource.com/22581 Reviewed-by: Ahmed W. Run-TryBot: Brad Fitzpatrick Reviewed-by: Brad Fitzpatrick --- diff --git a/src/os/exec/exec.go b/src/os/exec/exec.go index 76fcba90bf..5121b9b2cc 100644 --- a/src/os/exec/exec.go +++ b/src/os/exec/exec.go @@ -412,7 +412,7 @@ func (c *Cmd) WaitContext(ctx context.Context) error { var waitDone chan struct{} if ctx != nil { - waitDone := make(chan struct{}) + waitDone = make(chan struct{}) go func() { select { case <-ctx.Done():