mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-11-19 05:10:40 +00:00
bug #26027: netbuf_chain resulted in pbuf memory leak
This commit is contained in:
parent
b3a5d6df0d
commit
dbd6d7ec8d
@ -19,6 +19,9 @@ HISTORY
|
|||||||
|
|
||||||
++ New features:
|
++ New features:
|
||||||
|
|
||||||
|
2009-04-15 Simon Goldschmidt
|
||||||
|
* netbuf.c: bug #26027: netbuf_chain resulted in pbuf memory leak
|
||||||
|
|
||||||
2009-04-15 Simon Goldschmidt
|
2009-04-15 Simon Goldschmidt
|
||||||
* sockets.c, ppp.c: bug #25763: corrected 4 occurrences of SMEMCPY to MEMCPY
|
* sockets.c, ppp.c: bug #25763: corrected 4 occurrences of SMEMCPY to MEMCPY
|
||||||
|
|
||||||
|
@ -158,14 +158,14 @@ netbuf_ref(struct netbuf *buf, const void *dataptr, u16_t size)
|
|||||||
* Chain one netbuf to another (@see pbuf_chain)
|
* Chain one netbuf to another (@see pbuf_chain)
|
||||||
*
|
*
|
||||||
* @param head the first netbuf
|
* @param head the first netbuf
|
||||||
* @param tail netbuf to chain after head
|
* @param tail netbuf to chain after head, freed by this function, may not be reference after returning
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
netbuf_chain(struct netbuf *head, struct netbuf *tail)
|
netbuf_chain(struct netbuf *head, struct netbuf *tail)
|
||||||
{
|
{
|
||||||
LWIP_ERROR("netbuf_ref: invalid head", (head != NULL), return;);
|
LWIP_ERROR("netbuf_ref: invalid head", (head != NULL), return;);
|
||||||
LWIP_ERROR("netbuf_chain: invalid tail", (tail != NULL), return;);
|
LWIP_ERROR("netbuf_chain: invalid tail", (tail != NULL), return;);
|
||||||
pbuf_chain(head->p, tail->p);
|
pbuf_cat(head->p, tail->p);
|
||||||
head->ptr = head->p;
|
head->ptr = head->p;
|
||||||
memp_free(MEMP_NETBUF, tail);
|
memp_free(MEMP_NETBUF, tail);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user