]> granicus.if.org Git - php/commitdiff
- Fixed memory leak in openssl_pkcs12_export_to_file()
authorFelipe Pena <felipe@php.net>
Tue, 27 Oct 2009 21:37:03 +0000 (21:37 +0000)
committerFelipe Pena <felipe@php.net>
Tue, 27 Oct 2009 21:37:03 +0000 (21:37 +0000)
NEWS
ext/openssl/openssl.c

diff --git a/NEWS b/NEWS
index 85f2a2370732a3a06ec1bfe9f2a465377319cc6a..50c024924e46f6d740ff18570d808ca9fc26bb7a 100644 (file)
--- 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)
index 9e4fc2785fbdee9215d69586f30b91a4545af6d8..b42e52d4ff4d8247b8d313f683ff0e0681e52713 100644 (file)
@@ -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;