1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Fix memory leak in lookup_loc_range()

Closes GH-18723.
This commit is contained in:
Niels Dossche
2025-05-31 15:21:44 +02:00
parent 7f2299c8eb
commit d39d261b7e
2 changed files with 2 additions and 0 deletions

1
NEWS
View File

@@ -17,6 +17,7 @@ PHP NEWS
- Intl:
. Fix memory leak in intl_datetime_decompose() on failure. (nielsdos)
. Fix memory leak in locale lookup on failure. (nielsdos)
- Phar:
. Add missing filter cleanups on phar failure. (nielsdos)

View File

@@ -1499,6 +1499,7 @@ static zend_string* lookup_loc_range(const char* loc_range, HashTable* hash_arr,
zend_string_release_ex(can_loc_range, 0);
}
if(result == 0) {
efree(cur_loc_range);
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "lookup_loc_range: unable to canonicalize lang_tag" , 0);
LOOKUP_CLEAN_RETURN(NULL);
}