<div dir="ltr"><div>Could modifying packet->dataLength before being sent cause a leak?<span style="color:rgb(0,0,0);font-family:consolas,"lucida console",monospace;font-size:12.8px;background-color:rgb(240,247,255)"></span><br></div><div><br></div><div>I'm setting it to 0 after I create it and increasing the value based on the data I'm writing into packet->data.</div><div><br></div><div>I'm doing this when I don't know what will be the exact size of the data to be sent.</div><div><br></div><div>I assume enet will destroy all the data regardless of the dataLength value since it uses packet->data = enet_malloc(...) to allocate in enet_packet_create and enet_free(packet->data) to deallocate in enet_packet_destroy(...), but I don't know about enet's internal processes.<span style="color:rgb(0,0,0);font-family:consolas,"lucida console",monospace;font-size:12.8px;background-color:rgb(240,247,255)"></span><br></div><div><br></div>Example code: <a href="https://pastebin.com/QdaHjqft">https://pastebin.com/QdaHjqft</a></div>