Merge pull request #4963 from avaneyev/fix-fbx-document-duplicate-id-leak

Fix a leak in FBXDocument when duplicate object IDs are found
pull/4107/head
Kim Kulling 2023-02-23 10:53:40 +01:00 committed by GitHub
commit 46ae8534f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -381,8 +381,10 @@ void Document::ReadObjects() {
DOMError("encountered object with implicitly defined id 0",el.second);
}
if(objects.find(id) != objects.end()) {
const auto foundObject = objects.find(id);
if(foundObject != objects.end()) {
DOMWarning("encountered duplicate object id, ignoring first occurrence",el.second);
delete foundObject->second;
}
objects[id] = new LazyObject(id, *el.second, *this);