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:
parent
b2c4412e46
commit
2685125f05
1 changed files with 7 additions and 2 deletions
|
@ -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 &
|
||||||
|
|
Loading…
Reference in a new issue