Skip to content

Commit d70568e

Browse files
committed
intl: Fix memory leak in IntlChar::getFC_NFKC_Closure()
Free the closure buffer before the UTF-8 conversion status check, which returns early on failure. Closes GH-22252
1 parent 6501051 commit d70568e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

ext/intl/uchar/uchar.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,8 +525,8 @@ IC_METHOD(getFC_NFKC_Closure) {
525525

526526
error = U_ZERO_ERROR;
527527
u8str = intl_convert_utf16_to_utf8(closure, closure_len, &error);
528-
INTL_CHECK_STATUS(error, "Failed converting output to UTF8");
529528
efree(closure);
529+
INTL_CHECK_STATUS(error, "Failed converting output to UTF8");
530530
RETVAL_NEW_STR(u8str);
531531
}
532532
/* }}} */

0 commit comments

Comments
 (0)