diff --git a/RecastDemo/Source/InputGeom.cpp b/RecastDemo/Source/InputGeom.cpp index f1e0186..b532511 100644 --- a/RecastDemo/Source/InputGeom.cpp +++ b/RecastDemo/Source/InputGeom.cpp @@ -178,6 +178,7 @@ bool InputGeom::load(rcContext* ctx, const char* filePath) fclose(fp); if (readLen != 1) { + delete[] buf; return false; } diff --git a/RecastDemo/Source/MeshLoaderObj.cpp b/RecastDemo/Source/MeshLoaderObj.cpp index 2ba8fd8..9c50047 100644 --- a/RecastDemo/Source/MeshLoaderObj.cpp +++ b/RecastDemo/Source/MeshLoaderObj.cpp @@ -155,6 +155,7 @@ bool rcMeshLoaderObj::load(const char* filename) if (readLen != 1) { + delete[] buf; return false; } diff --git a/RecastDemo/Source/Sample_TempObstacles.cpp b/RecastDemo/Source/Sample_TempObstacles.cpp index b9f8ad3..967f50a 100644 --- a/RecastDemo/Source/Sample_TempObstacles.cpp +++ b/RecastDemo/Source/Sample_TempObstacles.cpp @@ -768,7 +768,7 @@ class TempObstacleCreateTool : public SampleTool public: - TempObstacleCreateTool() + TempObstacleCreateTool() : m_sample(0) { } diff --git a/RecastDemo/Source/TestCase.cpp b/RecastDemo/Source/TestCase.cpp index be72d24..a8e3e4d 100644 --- a/RecastDemo/Source/TestCase.cpp +++ b/RecastDemo/Source/TestCase.cpp @@ -110,6 +110,7 @@ bool TestCase::load(const char* filePath) fclose(fp); if (readLen != 1) { + delete[] buf; return false; } diff --git a/RecastDemo/Source/imguiRenderGL.cpp b/RecastDemo/Source/imguiRenderGL.cpp index 2c4e375..891b300 100644 --- a/RecastDemo/Source/imguiRenderGL.cpp +++ b/RecastDemo/Source/imguiRenderGL.cpp @@ -261,6 +261,7 @@ bool imguiRenderGLInit(const char* fontpath) fclose(fp); if (readLen != size) { + free(ttfBuffer); return false; }