From: Nikita Popov Date: Mon, 24 Jun 2019 07:30:59 +0000 (+0200) Subject: Fix region leak in mb_ereg_replace X-Git-Tag: php-7.4.0alpha2~6 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=46bad1d67975527a5b01e9140a799dbf64de8863;p=php Fix region leak in mb_ereg_replace --- diff --git a/ext/mbstring/php_mbregex.c b/ext/mbstring/php_mbregex.c index 9fac8233ba..d315712781 100644 --- a/ext/mbstring/php_mbregex.c +++ b/ext/mbstring/php_mbregex.c @@ -1157,7 +1157,7 @@ static void _php_mb_regex_ereg_replace_exec(INTERNAL_FUNCTION_PARAMETERS, OnigOp if (zend_eval_stringl(ZSTR_VAL(eval_str), ZSTR_LEN(eval_str), &v, description) == FAILURE) { efree(description); zend_throw_error(NULL, "Failed evaluating code: %s%s", PHP_EOL, ZSTR_VAL(eval_str)); - onig_region_free(regs, 0); + onig_region_free(regs, 1); smart_str_free(&out_buf); smart_str_free(&eval_buf); RETURN_FALSE;