diff --git a/src/core/tcp.c b/src/core/tcp.c index 925c0b13..3794d49e 100644 --- a/src/core/tcp.c +++ b/src/core/tcp.c @@ -862,42 +862,34 @@ tcp_fasttmr(void) * Deallocates a list of TCP segments (tcp_seg structures). * * @param seg tcp_seg list of TCP segments to free - * @return the number of pbufs that were deallocated */ -u8_t +void tcp_segs_free(struct tcp_seg *seg) { - u8_t count = 0; - struct tcp_seg *next; while (seg != NULL) { - next = seg->next; - count += tcp_seg_free(seg); + struct tcp_seg *next = seg->next; + tcp_seg_free(seg); seg = next; } - return count; } /** * Frees a TCP segment (tcp_seg structure). * * @param seg single tcp_seg to free - * @return the number of pbufs that were deallocated */ -u8_t +void tcp_seg_free(struct tcp_seg *seg) { - u8_t count = 0; - if (seg != NULL) { if (seg->p != NULL) { - count = pbuf_free(seg->p); + pbuf_free(seg->p); #if TCP_DEBUG seg->p = NULL; #endif /* TCP_DEBUG */ } memp_free(MEMP_TCP_SEG, seg); } - return count; } /** diff --git a/src/include/lwip/tcp.h b/src/include/lwip/tcp.h index 8c27354e..317916e4 100644 --- a/src/include/lwip/tcp.h +++ b/src/include/lwip/tcp.h @@ -579,8 +579,8 @@ struct tcp_pcb *tcp_pcb_copy(struct tcp_pcb *pcb); void tcp_pcb_purge(struct tcp_pcb *pcb); void tcp_pcb_remove(struct tcp_pcb **pcblist, struct tcp_pcb *pcb); -u8_t tcp_segs_free(struct tcp_seg *seg); -u8_t tcp_seg_free(struct tcp_seg *seg); +void tcp_segs_free(struct tcp_seg *seg); +void tcp_seg_free(struct tcp_seg *seg); struct tcp_seg *tcp_seg_copy(struct tcp_seg *seg); #define tcp_ack(pcb) \