Fixed accessing invalid memory when closing a listening pcb (introduced with tcp_shutdown)

This commit is contained in:
goldsimon 2010-03-01 18:43:37 +00:00
parent 8d9fa63460
commit 2b1c389955

View File

@ -233,8 +233,10 @@ tcp_close(struct tcp_pcb *pcb)
tcp_debug_print_state(pcb->state);
#endif /* TCP_DEBUG */
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);
}