]> granicus.if.org Git - php/commitdiff
- Fixed mem leak
authorDerick Rethans <derick@php.net>
Fri, 16 Mar 2001 15:59:45 +0000 (15:59 +0000)
committerDerick Rethans <derick@php.net>
Fri, 16 Mar 2001 15:59:45 +0000 (15:59 +0000)
ext/mcrypt/mcrypt.c

index be50c9e138f9c9ca95ce20ec3eee1676ef1745e9..c0c290c5b2d77272e091cd1799a1fb5c738f972e 100644 (file)
@@ -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);