- 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)
ext/openssl/openssl.c

index b1306a99e9216286b65370fbdc9db055b70ecad1..bafb33a3543a8c1e959b82d5fa65e326955ac6e4 100644 (file)
@@ -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);
        }