]> Cypherpunks repositories - gostls13.git/commitdiff
database/sql: fix possible context leak in test
authorAlexander Döring <email@alexd.ch>
Sun, 23 Oct 2016 21:13:59 +0000 (23:13 +0200)
committerBrad Fitzpatrick <bradfitz@golang.org>
Mon, 24 Oct 2016 17:56:11 +0000 (17:56 +0000)
Fixes #17560

Change-Id: I96fcdec87220391ef5432571b5c090b5be27491a
Reviewed-on: https://go-review.googlesource.com/31771
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/database/sql/sql_test.go

index 228a3f25804f89df2ae54fdf3192406cba120bde..34bbc6603e8ad3758a0fe65504596bc7c4c1a0c3 100644 (file)
@@ -267,6 +267,7 @@ func TestQueryContext(t *testing.T) {
        prepares0 := numPrepares(t, db)
 
        ctx, cancel := context.WithCancel(context.Background())
+       defer cancel()
 
        rows, err := db.QueryContext(ctx, "SELECT|people|age,name|")
        if err != nil {