mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-10-04 05:39:53 +00:00
Fixed accessing invalid memory when closing a listening pcb (introduced with tcp_shutdown)
This commit is contained in:
parent
8d9fa63460
commit
2b1c389955
@ -233,8 +233,10 @@ tcp_close(struct tcp_pcb *pcb)
|
|||||||
tcp_debug_print_state(pcb->state);
|
tcp_debug_print_state(pcb->state);
|
||||||
#endif /* TCP_DEBUG */
|
#endif /* TCP_DEBUG */
|
||||||
|
|
||||||
/* Set a flag not to receive any more data... */
|
if (pcb->state != LISTEN) {
|
||||||
pcb->flags |= TF_RXCLOSED;
|
/* Set a flag not to receive any more data... */
|
||||||
|
pcb->flags |= TF_RXCLOSED;
|
||||||
|
}
|
||||||
/* ... and close */
|
/* ... and close */
|
||||||
return tcp_close_shutdown(pcb, 1);
|
return tcp_close_shutdown(pcb, 1);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user