Permalink
Browse files

avoid stub leak on both branches of timeout toxic

  • Loading branch information...
jpittis authored and rmani committed Dec 17, 2018
1 parent a218e25 commit 1390d9962f16d8164610c9128c8b5581fd046081
Showing with 6 additions and 1 deletion.
  1. +6 −1 toxics/timeout.go
@@ -21,6 +21,7 @@ func (t *TimeoutToxic) Pipe(stub *ToxicStub) {
return
case c := <-stub.Input:
if c == nil {
stub.Close()
return
}
// Drop the data on the ground.
@@ -31,7 +32,11 @@ func (t *TimeoutToxic) Pipe(stub *ToxicStub) {
select {
case <-stub.Interrupt:
return
case <-stub.Input:
case c := <-stub.Input:
if c == nil {
stub.Close()
return
}
// Drop the data on the ground.
}
}

0 comments on commit 1390d99

Please sign in to comment.