1
0
mirror of https://github.com/golang/go synced 2024-11-22 05:34:39 -07:00

crypto/x509: do not forget to free cert context

R=golang-dev, krautz, rsc
CC=golang-dev
https://golang.org/cl/5783059
This commit is contained in:
Alex Brainman 2012-03-10 09:35:56 +11:00
parent 3cea4131df
commit 9fffe45c65

View File

@ -45,11 +45,7 @@ func createStoreContext(leaf *Certificate, opts *VerifyOptions) (*syscall.CertCo
} }
err = syscall.CertAddCertificateContextToStore(handle, ctx, syscall.CERT_STORE_ADD_ALWAYS, nil) err = syscall.CertAddCertificateContextToStore(handle, ctx, syscall.CERT_STORE_ADD_ALWAYS, nil)
if err != nil { syscall.CertFreeCertificateContext(ctx)
return nil, err
}
err = syscall.CertFreeCertificateContext(ctx)
if err != nil { if err != nil {
return nil, err return nil, err
} }