From: Dmitriy Vyukov Date: Sat, 5 Jul 2014 04:48:46 +0000 (+0400) Subject: debug/elf: fix nil deref in test X-Git-Tag: go1.4beta1~1162 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=735e38caceb3121ac8147449e56299a2f7df49f7;p=gostls13.git debug/elf: fix nil deref in test LGTM=crawshaw R=golang-codereviews, crawshaw CC=golang-codereviews https://golang.org/cl/109470044 --- diff --git a/src/pkg/debug/elf/file_test.go b/src/pkg/debug/elf/file_test.go index 7f88a54bcd..5e4ad5c100 100644 --- a/src/pkg/debug/elf/file_test.go +++ b/src/pkg/debug/elf/file_test.go @@ -166,11 +166,11 @@ func TestOpen(t *testing.T) { } else { f, err = Open(tt.file) } - defer f.Close() if err != nil { t.Errorf("cannot open file %s: %v", tt.file, err) continue } + defer f.Close() if !reflect.DeepEqual(f.FileHeader, tt.hdr) { t.Errorf("open %s:\n\thave %#v\n\twant %#v\n", tt.file, f.FileHeader, tt.hdr) continue