Skip to content

Commit b495ce0

Browse files
committed
Fix memleak on failure in collator_get_sort_key()
Closes GH-19138.
1 parent a8086be commit b495ce0

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ PHP NEWS
1717
(nielsdos)
1818
. Remove incorrect string release. (nielsdos)
1919

20+
- Intl:
21+
. Fix memleak on failure in collator_get_sort_key(). (nielsdos)
22+
2023
- LDAP:
2124
. Fixed GH-18902 ldap_exop/ldap_exop_sync assert triggered on empty
2225
request OID. (David Carlier)

ext/intl/collator/collator_sort.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,7 @@ PHP_FUNCTION( collator_get_sort_key )
556556
key_len = ucol_getSortKey(co->ucoll, ustr, ustr_len, (uint8_t*)ZSTR_VAL(key_str), key_len);
557557
efree( ustr );
558558
if(!key_len) {
559+
zend_string_efree(key_str);
559560
RETURN_FALSE;
560561
}
561562
ZSTR_LEN(key_str) = key_len - 1;

0 commit comments

Comments
 (0)