From a92b60b8bcfdec7ac603cdab939ac8e312251e27 Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Sun, 7 Jun 2026 16:52:28 -0400 Subject: [PATCH] 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. --- ext/intl/uchar/uchar.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/intl/uchar/uchar.c b/ext/intl/uchar/uchar.c index 4d3d424df798..f194e0e0b931 100644 --- a/ext/intl/uchar/uchar.c +++ b/ext/intl/uchar/uchar.c @@ -525,8 +525,8 @@ IC_METHOD(getFC_NFKC_Closure) { error = U_ZERO_ERROR; u8str = intl_convert_utf16_to_utf8(closure, closure_len, &error); - INTL_CHECK_STATUS(error, "Failed converting output to UTF8"); efree(closure); + INTL_CHECK_STATUS(error, "Failed converting output to UTF8"); RETVAL_NEW_STR(u8str); } /* }}} */