This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

the udp_send function cannot free the RAM

Hi,

I'm using the lwip 1.3.2 example project to do some Ethernet work, it was modified months before, so now it's not possible to use the new 1.4.1 example to modify the old project again. While, the problem is that when I use the udp_send() function to send a udp packet, the program cannot free the RAM space which allocated by the pbuf_alloc() function.

The member "ref" of the struct pbuf *p is 2(after the send program,the value is 2,but no free function ar called,so when the program need to free *p after the udp_send() function, the "ref" is not 1), so the pbuf_free() function called in the LocatorReceive() function in the locator.c file cannot free the ram space, which led to a dabort.

The question is where should I add the pbuf_free() function to let the value of the "ref" to "1"?

Hope you can help!

Regards,

yong