mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Fix memory leak when providing an invalid locale to IntlDateFormatter (#19764)
This commit is contained in:
committed by
GitHub
parent
c395355728
commit
b718514dc2
@@ -119,8 +119,8 @@ static zend_result datefmt_ctor(INTERNAL_FUNCTION_PARAMETERS, zend_error_handlin
|
||||
locale = Locale::createFromName(final_locale);
|
||||
/* get*Name accessors being set does not preclude being bogus */
|
||||
if (locale.isBogus() || ((locale_len == 1 && locale_str[0] != 'C') || (locale_len > 1 && strlen(locale.getISO3Language()) == 0))) {
|
||||
zend_argument_value_error(1, "\"%s\" is invalid", locale_str);
|
||||
return FAILURE;
|
||||
zend_argument_value_error(1, "\"%s\" is invalid", locale_str);
|
||||
goto error;
|
||||
}
|
||||
|
||||
/* process calendar */
|
||||
|
||||
Reference in New Issue
Block a user