0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-09-28 03:38:53 +02:00

ircd::openssl: Fix memleak.

This commit is contained in:
Jason Volk 2017-12-02 13:04:11 -08:00
parent b2c4412e46
commit 2685125f05

View file

@ -48,8 +48,13 @@ ircd::const_raw_buffer
ircd::openssl::cert2d(const mutable_raw_buffer &out,
const string_view &cert)
{
X509 x509 {0};
return i2d(out, read(&x509, cert));
const custom_ptr<X509> x509
{
X509_new(),
[](X509 *const x509) { X509_free(x509); }
};
return i2d(out, read(x509.get(), cert));
}
X509 &