lwip: fix socket close crash issue

When lwip_close free the socket resource (netconn etc), any work
related to these resource (netconn etc) must be aborted.
This commit is contained in:
Liu Zhi Fu
2017-11-07 20:10:02 +08:00
committed by bot
parent e64b9ecaf4
commit 48ca949fd4
4 changed files with 58 additions and 12 deletions

View File

@@ -405,6 +405,7 @@ tcp_abandon(struct tcp_pcb *pcb, int reset)
#if TCP_QUEUE_OOSEQ
if (pcb->ooseq != NULL) {
tcp_segs_free(pcb->ooseq);
pcb->ooseq = NULL;
}
#endif /* TCP_QUEUE_OOSEQ */
if (send_rst) {
@@ -1248,9 +1249,7 @@ tcp_seg_free(struct tcp_seg *seg)
if (seg != NULL) {
if (seg->p != NULL) {
pbuf_free(seg->p);
#if TCP_DEBUG
seg->p = NULL;
#endif /* TCP_DEBUG */
}
memp_free(MEMP_TCP_SEG, seg);
}