From b4c4fae3f5e257c1f1a96ecb84550d4b98dcba6a Mon Sep 17 00:00:00 2001 From: Simon Goldschmidt Date: Tue, 11 Oct 2011 21:41:58 +0200 Subject: [PATCH] slightly rearranged freeing an acked segment to prevent keeping the reference too long --- src/core/tcp_in.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/core/tcp_in.c b/src/core/tcp_in.c index 82ccedff..17ed0b01 100644 --- a/src/core/tcp_in.c +++ b/src/core/tcp_in.c @@ -688,6 +688,7 @@ tcp_process(struct tcp_pcb *pcb) LWIP_DEBUGF(TCP_QLEN_DEBUG, ("tcp_process: SYN-SENT --queuelen %"U16_F"\n", (u16_t)pcb->snd_queuelen)); rseg = pcb->unacked; pcb->unacked = rseg->next; + tcp_seg_free(rseg); /* If there's nothing left to acknowledge, stop the retransmit timer, otherwise reset it to start again */ @@ -698,8 +699,6 @@ tcp_process(struct tcp_pcb *pcb) pcb->nrtx = 0; } - tcp_seg_free(rseg); - /* Call the user specified function to call when sucessfully * connected. */ TCP_EVENT_CONNECTED(pcb, ERR_OK, err);