From 287b30ae5005e71e4cc5af5b9682d31876e4b96d Mon Sep 17 00:00:00 2001 From: Felipe Pena Date: Tue, 27 Oct 2009 21:37:03 +0000 Subject: [PATCH] - Fixed memory leak in openssl_pkcs12_export_to_file() --- ext/openssl/openssl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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); } -- 2.40.0