]> Cypherpunks repositories - gostls13.git/commitdiff
godoc: plug file descriptor leak
authorRuss Cox <rsc@golang.org>
Tue, 24 Nov 2009 21:21:14 +0000 (13:21 -0800)
committerRuss Cox <rsc@golang.org>
Tue, 24 Nov 2009 21:21:14 +0000 (13:21 -0800)
R=gri
CC=r
https://golang.org/cl/157149

src/cmd/godoc/godoc.go

index 7cf5a8519788da86c79386145823744de22e39b6..dd5278f8e746361eacbc5049096921a6db768a06 100644 (file)
@@ -859,6 +859,7 @@ func isTextFile(path string) bool {
        if err != nil {
                return false
        }
+       defer f.Close();
 
        var buf [1024]byte;
        n, err := f.Read(&buf);