Greetings, I'm creating a simple ping library to use in a larger project, but it seems that I've got myself a memory leak and I'm finding it hard to localize it. I'd appreciate if anyone could give me a tip how to find it.
Here's the code:
delete replyBuffer, sendBuffer;
Error is right there. Look up the comma operator - this only deletes replyBuffer, not sendBuffer.
And the use of delete is wrong for both - memory allocated by malloc must be freed via free() and memory allocated by new[] must be freed via delete[].