lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Pbuf_cat and pbuf_free question


From: Sergio R. Caprile
Subject: Re: [lwip-users] Pbuf_cat and pbuf_free question
Date: Fri, 13 Oct 2017 10:50:19 -0300
User-agent: Mozilla/5.0 (Windows NT 6.1; rv:52.0) Gecko/20100101 Thunderbird/52.4.0

Well, I'm no expert on whatever you are trying to do with this, so take it with a grain of salt.

you alloc a pbuf (1)
then you concatenate to the tail of another pbuf (0)
now (1) does not exist anymore as a lonely pbuf but is attached to (0), all that exists now is (0).
Somehow, you are supposed to have alloced (0), because it exists, right ?
You then send (0)
You have to free (0), not (1), but (0), unless you plan to use it again, but in that case, you won't allocate another "(1)", will you ? No, you won't.

If this does not fit your line of thought, perhaps you need to use pbuf_chain() or develop another strategy for your application code.



reply via email to

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