This commit is contained in:
jani 2003-11-05 09:27:48 +00:00
parent 2e6d032691
commit 18417fe7e6

View File

@ -768,12 +768,10 @@ tcp_segs_free(struct tcp_seg *seg)
{ {
u8_t count = 0; u8_t count = 0;
struct tcp_seg *next; struct tcp_seg *next;
again: while (seg != NULL) {
if (seg != NULL) {
next = seg->next; next = seg->next;
count += tcp_seg_free(seg); count += tcp_seg_free(seg);
seg = next; seg = next;
goto again;
} }
return count; return count;
} }
@ -791,15 +789,13 @@ tcp_seg_free(struct tcp_seg *seg)
u8_t count = 0; u8_t count = 0;
if (seg != NULL) { if (seg != NULL) {
if (seg->p == NULL) { if (seg->p != NULL) {
memp_free(MEMP_TCP_SEG, seg);
} else {
count = pbuf_free(seg->p); count = pbuf_free(seg->p);
#if TCP_DEBUG #if TCP_DEBUG
seg->p = NULL; seg->p = NULL;
#endif /* TCP_DEBUG */ #endif /* TCP_DEBUG */
memp_free(MEMP_TCP_SEG, seg);
} }
memp_free(MEMP_TCP_SEG, seg);
} }
return count; return count;
} }