From: Felipe Pena Date: Tue, 27 Oct 2009 21:37:03 +0000 (+0000) Subject: - Fixed memory leak in openssl_pkcs12_export_to_file() X-Git-Tag: php-5.2.12RC1~46 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dda3dfff9bc7f4245688581238fb1cf957562074;p=php - Fixed memory leak in openssl_pkcs12_export_to_file() --- diff --git a/NEWS b/NEWS index 85f2a23707..50c024924e 100644 --- a/NEWS +++ b/NEWS @@ -16,6 +16,7 @@ PHP NEWS when calling using Reflection. (Felipe) - Fixed crash when instantiating PDORow and PDOStatement through Reflection. (Felipe) +- Fixed memory leak in openssl_pkcs12_export_to_file(). (Felipe) - Fixed bug #49990 (SNMP3 warning message about security level printed twice). (Jani) diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index 9e4fc2785f..b42e52d4ff 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -1444,18 +1444,18 @@ PHP_FUNCTION(openssl_pkcs12_export_to_file) int filename_len; char * pass; int pass_len; - zval *zcert = NULL, *zpkey = NULL, *args = NULL; + zval **zcert = NULL, *zpkey = NULL, *args = NULL; EVP_PKEY *priv_key = NULL; long certresource, keyresource; zval ** item; STACK_OF(X509) *ca = NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zszs|a", &zcert, &filename, &filename_len, &zpkey, &pass, &pass_len, &args) == FAILURE) + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Zszs|a", &zcert, &filename, &filename_len, &zpkey, &pass, &pass_len, &args) == FAILURE) return; RETVAL_FALSE; - cert = php_openssl_x509_from_zval(&zcert, 0, &certresource TSRMLS_CC); + cert = php_openssl_x509_from_zval(zcert, 0, &certresource TSRMLS_CC); if (cert == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot get cert from parameter 1"); return;