lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] fix assert triggered in tcp_in.c


From: Leon Woestenberg
Subject: Re: [lwip-users] fix assert triggered in tcp_in.c
Date: Sat, 08 Apr 2006 00:32:18 +0200
User-agent: Thunderbird 1.5 (Windows/20051201)

Hello Pedro et al,

Christiaan Simons wrote:
Pedro Alves wrote:

Yep, that's right. Any change of getting it into cvs?

I'm not sure if this is 100% correct.

pbuf_free() does not guarantee the pbuf-chain is fully freed,
it may also lower some reference counters, or free the chain partially.
Sometimes multiple calls to pbuf_free in a loop maybe required.
Setting the pointer to NULL without checking the return value
of pbuf_free might actually result in a leak.
If the TCP code has only referenced this pbuf *exactly once* before, then a pbuf_free() followed
by NULLing its referencing pointer is OK.

So, please check that this is the case.

(If some other referer stills holds a reference, of course the pbuf still exists, but that's that referers problem now.)

I think therefore, the comment above the code needs fixing too.

I will fix this in CVS, and change the comment to reflect what the code really does.

Thanks for the fix.

Regards,

Leon.




reply via email to

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