lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] UDP pbuf->next problem?


From: Kieran Mansley
Subject: Re: [lwip-users] UDP pbuf->next problem?
Date: Thu, 15 Apr 2010 10:31:02 +0100

On Thu, 2010-04-15 at 11:07 +0200, Daniel Berenguer wrote:
> memcpy(myBuf, p->payload, p->len);
> bufLen += p->len;
> 
> // Commenting this block avoids the problem
> while((p->len != p->tot_len) && (p->next != NULL))
> {
>         p = p->next;
>         memcpy(myBuf+bufLen , p->payload, p->len);
>         bufLen += p->len;
> }
> 
> myBuf[bufLen] = 0;
> pbuf_free(p);

I think you need to call pbuf_free() on the first pbuf in the chain, not
just the last one.

Kieran





reply via email to

[Prev in Thread] Current Thread [Next in Thread]