lib/nbt: Fix a memory leak

Soda
BodgeMaster 2022-10-14 19:22:05 +02:00
parent 7be73f86d4
commit 3b56a52085
1 changed files with 1 additions and 0 deletions

View File

@ -1011,6 +1011,7 @@ namespace NBT {
ErrorOrVoid Compound::appendPointer(Generic* pointer) {
if (pointer->getTagType() == TagType::END) {
delete pointer;
return ErrorOrVoid(true, ErrorCodes::NOT_ALLOWED);
}
this->tags.push_back(pointer);