summaryrefslogtreecommitdiff
path: root/ext/openssl/openssl.c
diff options
context:
space:
mode:
authorFelipe Pena <felipe@php.net>2009-10-27 21:37:03 +0000
committerFelipe Pena <felipe@php.net>2009-10-27 21:37:03 +0000
commit287b30ae5005e71e4cc5af5b9682d31876e4b96d (patch)
treec4386d99629d160a90b7f3230ed7fb8eeabaeb9b /ext/openssl/openssl.c
parent3cb5f993a2d5601f85541a64a7a7ceeba6200293 (diff)
downloadphp-git-287b30ae5005e71e4cc5af5b9682d31876e4b96d.tar.gz
- Fixed memory leak in openssl_pkcs12_export_to_file()
Diffstat (limited to 'ext/openssl/openssl.c')
-rw-r--r--ext/openssl/openssl.c5
1 files 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);
}