fix double-free when adding cert to chain

Change-Id: I8d6fd56642ac5f87dd9fb4f78df64bb1f39494b7
This commit is contained in:
Andrew Harding 2015-10-12 14:55:54 -06:00
parent 4d3c3b16ef
commit 327ffad934

2
ctx.go
View File

@ -300,6 +300,8 @@ func (c *Ctx) AddChainCertificate(cert *Certificate) error {
if int(C.SSL_CTX_add_extra_chain_cert_not_a_macro(c.ctx, cert.x)) != 1 {
return errorFromErrorQueue()
}
// OpenSSL takes ownership via SSL_CTX_add_extra_chain_cert
runtime.SetFinalizer(cert, nil)
return nil
}