Loading pt.go +7 −2 Original line number Diff line number Diff line Loading @@ -616,12 +616,17 @@ func readAuthCookie(f io.Reader) ([]byte, error) { // Read and validate the contents of an auth cookie file. Returns the 32-byte // cookie. See section 4.2.1.2 of 217-ext-orport-auth.txt. func readAuthCookieFile(filename string) ([]byte, error) { func readAuthCookieFile(filename string) (cookie []byte, err error) { f, err := os.Open(filename) if err != nil { return nil, err } defer f.Close() defer func() { closeErr := f.Close() if err == nil { err = closeErr } }() return readAuthCookie(f) } Loading Loading
pt.go +7 −2 Original line number Diff line number Diff line Loading @@ -616,12 +616,17 @@ func readAuthCookie(f io.Reader) ([]byte, error) { // Read and validate the contents of an auth cookie file. Returns the 32-byte // cookie. See section 4.2.1.2 of 217-ext-orport-auth.txt. func readAuthCookieFile(filename string) ([]byte, error) { func readAuthCookieFile(filename string) (cookie []byte, err error) { f, err := os.Open(filename) if err != nil { return nil, err } defer f.Close() defer func() { closeErr := f.Close() if err == nil { err = closeErr } }() return readAuthCookie(f) } Loading