mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Fixed leak in RuleBasedBreakIterator constructor
The leak occurred in case of error.
This commit is contained in:
parent
d8d5f9a9f5
commit
01004c6abb
1 changed files with 2 additions and 0 deletions
|
@ -70,6 +70,7 @@ static void _php_intlrbbi_constructor_body(INTERNAL_FUNCTION_PARAMETERS)
|
|||
smart_str_free(&parse_error_str);
|
||||
intl_error_set_custom_msg(NULL, msg, 1 TSRMLS_CC);
|
||||
efree(msg);
|
||||
delete rbbi;
|
||||
RETURN_NULL();
|
||||
}
|
||||
} else { // compiled
|
||||
|
@ -78,6 +79,7 @@ static void _php_intlrbbi_constructor_body(INTERNAL_FUNCTION_PARAMETERS)
|
|||
if (U_FAILURE(status)) {
|
||||
intl_error_set(NULL, status, "rbbi_create_instance: unable to "
|
||||
"create instance from compiled rules", 0 TSRMLS_CC);
|
||||
delete rbbi;
|
||||
RETURN_NULL();
|
||||
}
|
||||
#else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue