From 9720ac01fce7771d07f3a06cdd3fc571594a834f Mon Sep 17 00:00:00 2001 From: Derick Rethans Date: Fri, 16 Mar 2001 15:59:45 +0000 Subject: [PATCH] - Fixed mem leak --- ext/mcrypt/mcrypt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ext/mcrypt/mcrypt.c b/ext/mcrypt/mcrypt.c index be50c9e138..c0c290c5b2 100644 --- a/ext/mcrypt/mcrypt.c +++ b/ext/mcrypt/mcrypt.c @@ -1211,7 +1211,7 @@ static void php_mcrypt_do_crypt (char* cipher, zval **key, zval **data, char *mo int block_size, max_key_length, use_key_length, i, count, iv_size; unsigned long int data_size; int *key_length_sizes; - char *key_s, *iv_s; + char *key_s = NULL, *iv_s; char *data_s; MCRYPT td; MCLS_FETCH(); @@ -1307,6 +1307,8 @@ static void php_mcrypt_do_crypt (char* cipher, zval **key, zval **data, char *mo /* freeing vars */ mcrypt_generic_end (td); + if (key_s != NULL) + efree (key_s); if (iv_s != NULL) efree (iv_s); efree (data_s); -- 2.40.0