diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2019-06-21 15:00:25 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-06-21 15:07:37 +0200 |
commit | 99f3e0f0ed6668097bf4fb2820f3e97db1197869 (patch) | |
tree | 9464c25f4a9f56d16863bbfa4333ae24640429bb /ext/openssl | |
parent | c939a67866536247325b204929d8b9cac021c71e (diff) | |
download | php-git-99f3e0f0ed6668097bf4fb2820f3e97db1197869.tar.gz |
Fix PKCS12 leak in openssl
Diffstat (limited to 'ext/openssl')
-rw-r--r-- | ext/openssl/openssl.c | 5 |
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); + } } /* }}} */ |