I'm not sure if my problem is a memory leak or buffer overflow since the error occurs in system free() with garbage in the memory chain. The difference I've added (among other things) is the use of PBUF_REF and pbuf_cat(). The following sequence works fine, but is it correct?
ref = pbuf_alloc(PBUF_RAW, 1024, PBUF_REF);
ref->payload = upptr;
pbuf_cat(head, ref);
udp_sendto(udp_raw, head, server, port);
pbuf_free(head);
I do NOT have pbuf_free(ref) because according the manual I'm not supposed to reference it again after using pbuf_cat(). Am I creating a memory leak, or is this OK?
Mike
_______________________________________________ lwip-users mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/lwip-users
