]> Cypherpunks repositories - gostls13.git/commitdiff
os/exec: fix variable shadow, don't leak goroutine
authorBrad Fitzpatrick <bradfitz@golang.org>
Thu, 28 Apr 2016 20:16:46 +0000 (15:16 -0500)
committerBrad Fitzpatrick <bradfitz@golang.org>
Thu, 28 Apr 2016 20:56:25 +0000 (20:56 +0000)
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. <oneofone@gmail.com>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/os/exec/exec.go

index 76fcba90bf383eb134ef8950ee3388c5e626e0e5..5121b9b2ccca48b97392882d2e475d77535d7a30 100644 (file)
@@ -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():