瀏覽代碼

Fixed: Correct memory leak found by cppcheck

Richard 10 年之前
父節點
當前提交
67cb86d166
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      code/MaterialSystem.cpp

+ 2 - 1
code/MaterialSystem.cpp

@@ -482,8 +482,9 @@ aiReturn aiMaterial::AddBinaryProperty (const void* pInput,
 
 
         aiMaterialProperty** ppTemp;
         aiMaterialProperty** ppTemp;
         try {
         try {
-        ppTemp = new aiMaterialProperty*[mNumAllocated];
+            ppTemp = new aiMaterialProperty*[mNumAllocated];
         } catch (std::bad_alloc&) {
         } catch (std::bad_alloc&) {
+            delete pcNew;
             return AI_OUTOFMEMORY;
             return AI_OUTOFMEMORY;
         }
         }