mirror of
https://github.com/espressif/esp-idf
synced 2025-03-10 17:49:10 -04:00
lwip: Fix leak when accept() fails due to max socket limit
As reported https://esp32.com/viewtopic.php?f=14&t=6171 event_callback() in sockets.c calls conn->socket-- to register activity on a netconn which may not have any socket yet, so any socket value < 0 indicates "no controlling socket" for the netconn.
This commit is contained in:
parent
b47c8fcbf7
commit
df816f4940
@ -139,7 +139,7 @@ netconn_new_with_proto_and_callback(enum netconn_type t, u8_t proto, netconn_cal
|
||||
static inline bool is_created_by_socket(struct netconn *conn)
|
||||
{
|
||||
#if LWIP_SOCKET
|
||||
if (conn && (conn->socket != -1)) {
|
||||
if (conn && (conn->socket >= 0)) {
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user