Merge pull request #3748 from assimp/kimkulling-issue_3747

Fix direct leak
pull/3695/head^2
Kim Kulling 2021-04-05 21:37:48 +02:00 committed by GitHub
commit d51fce9e70
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -157,7 +157,10 @@ void HMPImporter::InternReadFile(const std::string &pFile,
szBuffer[2] = ((char *)&iMagic)[2];
szBuffer[3] = ((char *)&iMagic)[3];
szBuffer[4] = '\0';
delete[] mBuffer;
mBuffer = nullptr;
// We're definitely unable to load this file
throw DeadlyImportError("Unknown HMP subformat ", pFile,
". Magic word (", szBuffer, ") is not known");