mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-01-27 12:35:26 +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);
|
||||
#endif /* TCP_DEBUG */
|
||||
|
||||
/* Set a flag not to receive any more data... */
|
||||
pcb->flags |= TF_RXCLOSED;
|
||||
if (pcb->state != LISTEN) {
|
||||
/* Set a flag not to receive any more data... */
|
||||
pcb->flags |= TF_RXCLOSED;
|
||||
}
|
||||
/* ... and close */
|
||||
return tcp_close_shutdown(pcb, 1);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user