Skip to content

Commit db15a26

Browse files
gekyadbridge
authored andcommitted
lwip - Fixed handling of max sockets in socket_accept
1 parent 01c56d4 commit db15a26

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

features/net/FEATURE_IPV4/lwip-interface/lwip_stack.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,9 @@ static int lwip_socket_accept(nsapi_stack_t *stack, nsapi_socket_t *handle, nsap
313313
{
314314
struct lwip_socket *s = (struct lwip_socket *)server;
315315
struct lwip_socket *ns = lwip_arena_alloc();
316+
if (!ns) {
317+
return NSAPI_ERROR_NO_SOCKET;
318+
}
316319

317320
err_t err = netconn_accept(s->conn, &ns->conn);
318321
if (err != ERR_OK) {

0 commit comments

Comments
 (0)