]> Cypherpunks repositories - gostls13.git/commitdiff
crypto/x509: do not forget to free cert context
authorAlex Brainman <alex.brainman@gmail.com>
Fri, 9 Mar 2012 22:35:56 +0000 (09:35 +1100)
committerAlex Brainman <alex.brainman@gmail.com>
Fri, 9 Mar 2012 22:35:56 +0000 (09:35 +1100)
R=golang-dev, krautz, rsc
CC=golang-dev
https://golang.org/cl/5783059

src/pkg/crypto/x509/root_windows.go

index 8f7980ae4a6dab925df4cf2875f0a0f35f04788f..7e8f2af4b0ea94304a0818982c50365e5c3a3c26 100644 (file)
@@ -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
                        }