Skip to content

Commit 1d8cb11

Browse files
committed
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
1 parent a7223e7 commit 1d8cb11

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

ext/sockets/sockets.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1646,6 +1646,7 @@ PHP_FUNCTION(socket_recvfrom)
16461646
*/
16471647
#endif
16481648
default:
1649+
zend_string_efree(recv_buf);
16491650
zend_argument_value_error(1, "must be one of AF_UNIX, AF_INET, or AF_INET6");
16501651
RETURN_THROWS();
16511652
}

0 commit comments

Comments
 (0)