mirror of
https://github.com/espressif/esp-lwip.git
synced 2026-06-05 21:04:45 +00:00
sockets: Fix potential race when socket is closed already
Ref IDF-4794
This commit is contained in:
@@ -443,6 +443,10 @@ tryget_socket_unconn_locked(int fd)
|
||||
{
|
||||
struct lwip_sock *ret = tryget_socket_unconn_nouse(fd);
|
||||
if (ret != NULL) {
|
||||
#if ESP_LWIP
|
||||
if (ret->conn == NULL)
|
||||
return NULL;
|
||||
#endif /* ESP_LWIP */
|
||||
if (!sock_inc_used_locked(ret)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user