From 1d8cb113ebc4c1b386baa7f07e1665f6f10ff910 Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Sun, 7 Jun 2026 15:39:11 -0400 Subject: [PATCH 1/2] sockets: Fix memory leak in socket_recvfrom() Free recv_buf on the unknown address-family error path, matching the other switch cases. Closes GH-22251 --- ext/sockets/sockets.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ext/sockets/sockets.c b/ext/sockets/sockets.c index 7be7554d4123..7b9b903585b8 100644 --- a/ext/sockets/sockets.c +++ b/ext/sockets/sockets.c @@ -1646,6 +1646,7 @@ PHP_FUNCTION(socket_recvfrom) */ #endif default: + zend_string_efree(recv_buf); zend_argument_value_error(1, "must be one of AF_UNIX, AF_INET, or AF_INET6"); RETURN_THROWS(); } From d70568ea9f0d9f10e8bcd4fcddd8bfad9a58cb00 Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Sun, 7 Jun 2026 16:52:28 -0400 Subject: [PATCH 2/2] 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 --- 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); } /* }}} */