larku / RakNet

RakNet is a cross platform, open source, C++ networking engine for game programmers.
Other
60 stars 27 forks source link

Fix 3 memory leaks in AutoPatcher/ApplyPatch.cpp #20

Closed larku closed 9 years ago

larku commented 9 years ago

This commit fixes three memory leaks in the AutoPatcher code:

ApplyPatch.cpp:288: patch = new char[patchSize]; ApplyPatch.cpp:289: old = new char[oldSize]; ApplyPatch.cpp:191: _new = new char[*newSize+1];

These buffers aren't deleted when returning from int TestPatchInMemory(int argc, char*argv[]) at line 300 of the original sources, so (patchSize + oldSize + newSize + 1) bytes of memory are leaked.