summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2019-06-21 15:00:25 +0200
committerNikita Popov <nikita.ppv@gmail.com>2019-06-21 15:07:37 +0200
commit99f3e0f0ed6668097bf4fb2820f3e97db1197869 (patch)
tree9464c25f4a9f56d16863bbfa4333ae24640429bb
parentc939a67866536247325b204929d8b9cac021c71e (diff)
downloadphp-git-99f3e0f0ed6668097bf4fb2820f3e97db1197869.tar.gz
Fix PKCS12 leak in openssl
-rw-r--r--ext/openssl/openssl.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index c1560fa884..6c1dd9d343 100644
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -3029,8 +3029,6 @@ PHP_FUNCTION(openssl_pkcs12_read)
}
RETVAL_TRUE;
-
- PKCS12_free(p12);
} else {
php_openssl_store_errors();
}
@@ -3045,6 +3043,9 @@ PHP_FUNCTION(openssl_pkcs12_read)
if (cert) {
X509_free(cert);
}
+ if (p12) {
+ PKCS12_free(p12);
+ }
}
/* }}} */