Fix one byte memory leak.

pull/2705/head
Malcolm Tyrrell 2019-10-08 15:15:16 +01:00
parent f8bdb77de1
commit 3b3e34c36a
1 changed files with 2 additions and 0 deletions

View File

@ -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();
}