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
1 changed files with 1 additions and 1 deletions
|
@ -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)
|
static inline bool is_created_by_socket(struct netconn *conn)
|
||||||
{
|
{
|
||||||
#if LWIP_SOCKET
|
#if LWIP_SOCKET
|
||||||
if (conn && (conn->socket != -1)) {
|
if (conn && (conn->socket >= 0)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue