From: Anatol Belski Date: Sat, 8 Oct 2016 17:25:36 +0000 (+0200) Subject: Merge branch 'PHP-5.6' into PHP-7.0 X-Git-Tag: php-7.1.0RC4~76^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6f84ac721b2674dc056430c420c839f4d2fe5b74;p=php Merge branch 'PHP-5.6' into PHP-7.0 * PHP-5.6: fix leak --- 6f84ac721b2674dc056430c420c839f4d2fe5b74 diff --cc ext/mcrypt/mcrypt.c index 9865cbb9fc,66382aeb7c..e7bdd43c9b --- a/ext/mcrypt/mcrypt.c +++ b/ext/mcrypt/mcrypt.c @@@ -1298,8 -1309,9 +1298,9 @@@ static void php_mcrypt_do_crypt(char* c memcpy(data_s, data, data_len); } - if (mcrypt_generic_init(td, (void *) key, key_len, (void *) iv) < 0) { + if (mcrypt_generic_init(td, (void *) key, (int)key_len, (void *) iv) < 0) { + efree(data_s); - php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Mcrypt initialisation failed"); + php_error_docref(NULL, E_RECOVERABLE_ERROR, "Mcrypt initialisation failed"); mcrypt_module_close(td); RETURN_FALSE; }