From 90cb3743be293aab801a78196ad038c039786c19 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Fri, 21 Jun 2019 14:03:06 +0200 Subject: [PATCH] Free cert in php_openssl_load_stream_cafile() X509_STORE_add_cert() increments the refcount of the cert, so we should free it here. --- ext/openssl/xp_ssl.c | 1 + 1 file changed, 1 insertion(+) 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; } -- 2.40.0