Compare commits

...

2 Commits

Author SHA1 Message Date
Steven Fackler
95c7bf3cba Release openssl v0.9.24 2018-02-12 11:19:10 -08:00
Steven Fackler
62514d376e Don't leak X509s
(cherry picked from commit b1ab0ec473)
2018-02-12 11:03:09 -08:00
2 changed files with 3 additions and 4 deletions

View File

@ -1,6 +1,6 @@
[package]
name = "openssl"
version = "0.9.23"
version = "0.9.24"
authors = ["Steven Fackler <sfackler@gmail.com>"]
license = "Apache-2.0"
description = "OpenSSL bindings"

View File

@ -36,11 +36,10 @@ impl X509StoreBuilder {
impl X509StoreBuilderRef {
/// Adds a certificate to the certificate store.
// FIXME should take an &X509Ref
pub fn add_cert(&mut self, cert: X509) -> Result<(), ErrorStack> {
unsafe {
let ptr = cert.as_ptr();
mem::forget(cert); // the cert will be freed inside of X509_STORE_add_cert on error
cvt(ffi::X509_STORE_add_cert(self.as_ptr(), ptr)).map(|_| ())
cvt(ffi::X509_STORE_add_cert(self.as_ptr(), cert.as_ptr())).map(|_| ())
}
}