mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-02 12:14:32 +02: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:
committed by
Angus Gratton
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)
|
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
|
||||||
|
Reference in New Issue
Block a user