From: Alex Brainman Date: Fri, 9 Mar 2012 22:35:56 +0000 (+1100) Subject: crypto/x509: do not forget to free cert context X-Git-Tag: weekly.2012-03-13~62 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=9fffe45c6551a495f00d5593e941f7f1b1b7e784;p=gostls13.git crypto/x509: do not forget to free cert context R=golang-dev, krautz, rsc CC=golang-dev https://golang.org/cl/5783059 --- diff --git a/src/pkg/crypto/x509/root_windows.go b/src/pkg/crypto/x509/root_windows.go index 8f7980ae4a..7e8f2af4b0 100644 --- a/src/pkg/crypto/x509/root_windows.go +++ b/src/pkg/crypto/x509/root_windows.go @@ -45,11 +45,7 @@ func createStoreContext(leaf *Certificate, opts *VerifyOptions) (*syscall.CertCo } err = syscall.CertAddCertificateContextToStore(handle, ctx, syscall.CERT_STORE_ADD_ALWAYS, nil) - if err != nil { - return nil, err - } - - err = syscall.CertFreeCertificateContext(ctx) + syscall.CertFreeCertificateContext(ctx) if err != nil { return nil, err }