summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2019-06-21 14:03:06 +0200
committerNikita Popov <nikita.ppv@gmail.com>2019-06-21 15:07:00 +0200
commit90cb3743be293aab801a78196ad038c039786c19 (patch)
tree8bfee8afc127c540b0466b47553dc2a597dcd38e
parentfea9f93166a31760679101269aee2326ee8185e9 (diff)
downloadphp-git-90cb3743be293aab801a78196ad038c039786c19.tar.gz
Free cert in php_openssl_load_stream_cafile()
X509_STORE_add_cert() increments the refcount of the cert, so we should free it here.
-rw-r--r--ext/openssl/xp_ssl.c1
1 files changed, 1 insertions, 0 deletions
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;
}