mirror of
https://github.com/libp2p/go-openssl.git
synced 2024-12-28 23:50:14 +08:00
fix double-free when adding cert to chain
Change-Id: I8d6fd56642ac5f87dd9fb4f78df64bb1f39494b7
This commit is contained in:
parent
4d3c3b16ef
commit
327ffad934
2
ctx.go
2
ctx.go
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user