diff --git a/src/api/sockets.c b/src/api/sockets.c index 08bd846c..11a1a2df 100644 --- a/src/api/sockets.c +++ b/src/api/sockets.c @@ -299,9 +299,9 @@ lwip_close(int s) return -1; } + sys_sem_wait(socksem); netconn_delete(sock->conn); - sys_sem_wait(socksem); if (sock->lastdata) { netbuf_delete(sock->lastdata); }