From 67cb86d1662986ee8f013aee6524aa45d083a548 Mon Sep 17 00:00:00 2001 From: Richard Date: Wed, 1 Jul 2015 20:43:49 -0600 Subject: [PATCH] Fixed: Correct memory leak found by cppcheck --- code/MaterialSystem.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/MaterialSystem.cpp b/code/MaterialSystem.cpp index dc8f5fc5e..aa17d5458 100644 --- a/code/MaterialSystem.cpp +++ b/code/MaterialSystem.cpp @@ -482,8 +482,9 @@ aiReturn aiMaterial::AddBinaryProperty (const void* pInput, aiMaterialProperty** ppTemp; try { - ppTemp = new aiMaterialProperty*[mNumAllocated]; + ppTemp = new aiMaterialProperty*[mNumAllocated]; } catch (std::bad_alloc&) { + delete pcNew; return AI_OUTOFMEMORY; }