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.4.0alpha1~191^2~2454 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=287b30ae5005e71e4cc5af5b9682d31876e4b96d;p=php - Fixed memory leak in openssl_pkcs12_export_to_file() --- diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index b1306a99e9..bafb33a354 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -2796,6 +2796,9 @@ static EVP_PKEY * php_openssl_evp_from_zval(zval ** val, int public_key, char * if (Z_TYPE_PP(val) == IS_UNICODE && !filename) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Binary string expected, Unicode string received"); + if (free_phrase) { + efree(passphrase); + } return NULL; } @@ -4737,14 +4740,12 @@ SSL *php_SSL_new_from_context(SSL_CTX *ctx, php_stream *stream TSRMLS_DC) /* {{{ static void openssl_add_method_or_alias(const OBJ_NAME *name, void *arg) /* {{{ */ { - TSRMLS_FETCH(); add_next_index_ascii_string((zval*)arg, (char*)name->name, 1); } /* }}} */ static void openssl_add_method(const OBJ_NAME *name, void *arg) /* {{{ */ { - TSRMLS_FETCH(); if (name->alias == 0) { add_next_index_ascii_string((zval*)arg, (char*)name->name, 1); }