]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-5.6' into PHP-7.0
authorAnatol Belski <ab@php.net>
Sat, 8 Oct 2016 17:25:36 +0000 (19:25 +0200)
committerAnatol Belski <ab@php.net>
Sat, 8 Oct 2016 17:25:36 +0000 (19:25 +0200)
* PHP-5.6:
  fix leak

1  2 
ext/mcrypt/mcrypt.c

index 9865cbb9fcc39de9c1d340206d3b8bd11580e93d,66382aeb7c7a233496ea56bfd4877900f7234344..e7bdd43c9bb2c449e1e6da065babd96ddf277cb8
@@@ -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;
        }