From 09ca7a181bbf0520a4f5296ce7d5bf5421d11ffa Mon Sep 17 00:00:00 2001 From: davidhaas Date: Mon, 31 Mar 2003 22:09:39 +0000 Subject: [PATCH] In keeping with pbuf->ref always having the count of the number of pointers to the particular buffer (and the last rewrite of pbuf_free), changed most pbuf_ref_chain() calls back to pbuf_ref(). I think this was causing some pbuf leaks. --- src/core/tcp.c | 2 +- src/netif/etharp.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/tcp.c b/src/core/tcp.c index 773bb543..0258f509 100644 --- a/src/core/tcp.c +++ b/src/core/tcp.c @@ -719,7 +719,7 @@ tcp_seg_copy(struct tcp_seg *seg) return NULL; } memcpy((char *)cseg, (const char *)seg, sizeof(struct tcp_seg)); - pbuf_ref_chain(cseg->p); + pbuf_ref(cseg->p); return cseg; } /*-----------------------------------------------------------------------------------*/ diff --git a/src/netif/etharp.c b/src/netif/etharp.c index 6565ab2e..a0f05996 100644 --- a/src/netif/etharp.c +++ b/src/netif/etharp.c @@ -687,7 +687,7 @@ struct pbuf *etharp_query(struct netif *netif, struct ip_addr *ipaddr, struct pb /* copy PBUF_REF referenced payloads to PBUF_RAM */ q = pbuf_take(q); /* pbufs are queued, increase the reference count */ - pbuf_ref_chain(q); + pbuf_ref(q); /* remember pbuf to queue, if any */ arp_table[i].p = q; DEBUGF(ETHARP_DEBUG | DBG_TRACE | DBG_STATE, ("etharp_query: queued packet %p on ARP entry %u.\n", (void *)q, i));