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.
This commit is contained in:
davidhaas 2003-03-31 22:09:39 +00:00
parent 82a32be1d6
commit 09ca7a181b
2 changed files with 2 additions and 2 deletions

View File

@ -719,7 +719,7 @@ tcp_seg_copy(struct tcp_seg *seg)
return NULL; return NULL;
} }
memcpy((char *)cseg, (const char *)seg, sizeof(struct tcp_seg)); memcpy((char *)cseg, (const char *)seg, sizeof(struct tcp_seg));
pbuf_ref_chain(cseg->p); pbuf_ref(cseg->p);
return cseg; return cseg;
} }
/*-----------------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------------*/

View File

@ -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 */ /* copy PBUF_REF referenced payloads to PBUF_RAM */
q = pbuf_take(q); q = pbuf_take(q);
/* pbufs are queued, increase the reference count */ /* pbufs are queued, increase the reference count */
pbuf_ref_chain(q); pbuf_ref(q);
/* remember pbuf to queue, if any */ /* remember pbuf to queue, if any */
arp_table[i].p = q; 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)); DEBUGF(ETHARP_DEBUG | DBG_TRACE | DBG_STATE, ("etharp_query: queued packet %p on ARP entry %u.\n", (void *)q, i));