Skip to content

Commit d39d261

Browse files
committed
Fix memory leak in lookup_loc_range()
Closes phpGH-18723.
1 parent 7f2299c commit d39d261

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ PHP NEWS
1717

1818
- Intl:
1919
. Fix memory leak in intl_datetime_decompose() on failure. (nielsdos)
20+
. Fix memory leak in locale lookup on failure. (nielsdos)
2021

2122
- Phar:
2223
. Add missing filter cleanups on phar failure. (nielsdos)

ext/intl/locale/locale_methods.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1499,6 +1499,7 @@ static zend_string* lookup_loc_range(const char* loc_range, HashTable* hash_arr,
14991499
zend_string_release_ex(can_loc_range, 0);
15001500
}
15011501
if(result == 0) {
1502+
efree(cur_loc_range);
15021503
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "lookup_loc_range: unable to canonicalize lang_tag" , 0);
15031504
LOOKUP_CLEAN_RETURN(NULL);
15041505
}

0 commit comments

Comments
 (0)