mirror of
https://github.com/espressif/esp-idf.git
synced 2025-09-25 17:52:36 +00:00
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:
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user