com php-src: fix leak: ext/mcrypt/mcrypt.c
| From: | Anatol Belski | Date: | Sat, 08 Oct 2016 17:07:35 +0000 |
| Subject: | com php-src: fix leak: ext/mcrypt/mcrypt.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-94872@lists.php.net to get a copy of this message | ||
Commit: 3c5742ebd735d03468048edbca434769dffec8f4
Author: Anatol Belski <ab@php.net> Sat, 8 Oct 2016 19:07:35 +0200
Parents: b061fa909de77085d3822a89ab901b934d0362c4
Branches: PHP-5.6 PHP-7.0 PHP-7.1 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=3c5742ebd735d03468048edbca434769dffec8f4
Log:
fix leak
Changed paths:
M ext/mcrypt/mcrypt.c
Diff:
diff --git a/ext/mcrypt/mcrypt.c b/ext/mcrypt/mcrypt.c
index 7539d9e..66382ae 100644
--- a/ext/mcrypt/mcrypt.c
+++ b/ext/mcrypt/mcrypt.c
@@ -1310,6 +1310,7 @@ static void php_mcrypt_do_crypt(char* cipher, const char *key, int key_len,
cons
}
if (mcrypt_generic_init(td, (void *) key, key_len, (void *) iv) < 0) {
+ efree(data_s);
php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Mcrypt initialisation failed");
mcrypt_module_close(td);
RETURN_FALSE;