diff options
author | Bob Weinand <bobwei9@hotmail.com> | 2017-10-12 12:30:20 +0200 |
---|---|---|
committer | Bob Weinand <bobwei9@hotmail.com> | 2017-10-12 12:30:20 +0200 |
commit | a55af1e2719d2f0abac21a9a3db04f960b4fbd38 (patch) | |
tree | 77a1eb4ce88d0ab6540f100bd583ba692d3f9014 /ext/openssl | |
parent | 23e97b022226a2b790f9b1b1f5a96959501be647 (diff) | |
download | php-git-a55af1e2719d2f0abac21a9a3db04f960b4fbd38.tar.gz |
Fixed bug #75363 (openssl_x509_parse leaks memory)
Diffstat (limited to 'ext/openssl')
-rw-r--r-- | ext/openssl/openssl.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index 2107b9ba59..9784ac49a7 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -2168,7 +2168,6 @@ PHP_FUNCTION(openssl_x509_parse) { zval * zcert; X509 * cert = NULL; - zend_resource *certresource = NULL; int i, sig_nid; zend_bool useshortnames = 1; char * tmpstr; @@ -2188,7 +2187,7 @@ PHP_FUNCTION(openssl_x509_parse) if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|b", &zcert, &useshortnames) == FAILURE) { return; } - cert = php_openssl_x509_from_zval(zcert, 0, &certresource); + cert = php_openssl_x509_from_zval(zcert, 0, NULL); if (cert == NULL) { RETURN_FALSE; } @@ -2298,9 +2297,6 @@ PHP_FUNCTION(openssl_x509_parse) add_assoc_stringl(&subitem, extname, bio_buf->data, bio_buf->length); } else { zval_dtor(return_value); - if (certresource == NULL && cert) { - X509_free(cert); - } BIO_free(bio_out); RETURN_FALSE; } @@ -2314,10 +2310,6 @@ PHP_FUNCTION(openssl_x509_parse) BIO_free(bio_out); } add_assoc_zval(return_value, "extensions", &subitem); - - if (certresource == NULL && cert) { - X509_free(cert); - } } /* }}} */ |