mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-11-18 20:10:53 +00:00
Reset the callbacks and arg (conn) to NULL in do_close_internal(), because
TCP callbacks in api_msg.c can under certain circumstances be called with an invalid conn pointer after the connection has been closed (and conn has been freed).
This commit is contained in:
parent
acbf25f2eb
commit
180e6d2c75
@ -452,6 +452,12 @@ do_close_internal(struct netconn *conn)
|
|||||||
if (err == ERR_OK) {
|
if (err == ERR_OK) {
|
||||||
/* Closing succeeded */
|
/* Closing succeeded */
|
||||||
conn->state = NETCONN_NONE;
|
conn->state = NETCONN_NONE;
|
||||||
|
/* Set back some callback pointers as conn is going away */
|
||||||
|
tcp_err(conn->pcb.tcp, NULL);
|
||||||
|
tcp_poll(conn->pcb.tcp, NULL, 4);
|
||||||
|
tcp_sent(conn->pcb.tcp, NULL);
|
||||||
|
tcp_recv(conn->pcb.tcp, NULL);
|
||||||
|
tcp_arg(conn->pcb.tcp, NULL);
|
||||||
conn->pcb.tcp = NULL;
|
conn->pcb.tcp = NULL;
|
||||||
conn->err = err;
|
conn->err = err;
|
||||||
/* Trigger select() in socket layer */
|
/* Trigger select() in socket layer */
|
||||||
|
Loading…
Reference in New Issue
Block a user