From 3b3e34c36a49ddd94b50c5635b7892d004198f59 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Tue, 8 Oct 2019 15:15:16 +0100 Subject: [PATCH] Fix one byte memory leak. --- code/glTF/glTFImporter.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/glTF/glTFImporter.cpp b/code/glTF/glTFImporter.cpp index 3a521554f..9ec13ea69 100644 --- a/code/glTF/glTFImporter.cpp +++ b/code/glTF/glTFImporter.cpp @@ -170,6 +170,8 @@ void glTFImporter::ImportMaterials(glTF::Asset& r) { if (mScene->mNumMaterials == 0) { mScene->mNumMaterials = 1; + // Delete the array of length zero created above. + delete[] mScene->mMaterials; mScene->mMaterials = new aiMaterial*[1]; mScene->mMaterials[0] = new aiMaterial(); }