From: Nikita Popov Date: Fri, 21 Jun 2019 12:03:06 +0000 (+0200) Subject: Free cert in php_openssl_load_stream_cafile() X-Git-Tag: php-7.2.21RC1~34 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=90cb3743be293aab801a78196ad038c039786c19;p=php Free cert in php_openssl_load_stream_cafile() X509_STORE_add_cert() increments the refcount of the cert, so we should free it here. --- diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c index a423da6e74..c8e5692bbe 100644 --- a/ext/openssl/xp_ssl.c +++ b/ext/openssl/xp_ssl.c @@ -827,6 +827,7 @@ static long php_openssl_load_stream_cafile(X509_STORE *cert_store, const char *c buffer_active = 0; if (cert && X509_STORE_add_cert(cert_store, cert)) { ++certs_added; + X509_free(cert); } goto cert_start; }