Skip to content

Commit 506aa3d

Browse files
committed
lwip - Fixed handling of max sockets in socket_accept
1 parent 9111aa4 commit 506aa3d

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
@@ -308,6 +308,9 @@ static int lwip_socket_accept(nsapi_stack_t *stack, nsapi_socket_t server, nsapi
308308
{
309309
struct lwip_socket *s = (struct lwip_socket *)server;
310310
struct lwip_socket *ns = lwip_arena_alloc();
311+
if (!ns) {
312+
return NSAPI_ERROR_NO_SOCKET;
313+
}
311314

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

0 commit comments

Comments
 (0)