Skip to content

Commit c8028af

Browse files
committed
ext/mbstring: mb_ereg*_replace fix leak on failed callback.
1 parent c978111 commit c8028af

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

ext/mbstring/php_mbregex.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,6 +1109,7 @@ static void _php_mb_regex_ereg_replace_exec(INTERNAL_FUNCTION_PARAMETERS, OnigOp
11091109
} else {
11101110
if (!EG(exception)) {
11111111
zend_throw_error(NULL, "Unable to call custom replacement function");
1112+
onig_region_free(regs, 1);
11121113
zval_ptr_dtor(&subpats);
11131114
RETURN_THROWS();
11141115
}

0 commit comments

Comments
 (0)