sockets: Fix potential race when socket is closed already

Ref IDF-4794
This commit is contained in:
xueyunfei
2019-08-30 14:00:14 +08:00
committed by David Cermak
parent d058bbbe25
commit 882716f729
+4
View File
@@ -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;
}