0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-16 06:51:08 +01: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, ircd::openssl::cert2d(const mutable_raw_buffer &out,
const string_view &cert) const string_view &cert)
{ {
X509 x509 {0}; const custom_ptr<X509> x509
return i2d(out, read(&x509, cert)); {
X509_new(),
[](X509 *const x509) { X509_free(x509); }
};
return i2d(out, read(x509.get(), cert));
} }
X509 & X509 &