cid#1500511 silence Resource leak

Change-Id: I37cdd52d965112598249b929fa49c759a88606c9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131002
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
Caolán McNamara
2022-03-04 15:40:01 +00:00
parent f3226c540d
commit bc9b5c830f

View File

@@ -779,8 +779,7 @@ void handleEnumType(
std::unique_ptr< ClassFile::Code > blockCode(cf->newCode()); std::unique_ptr< ClassFile::Code > blockCode(cf->newCode());
blockCode->instrGetstatic(className, pair.second, classDescriptor); blockCode->instrGetstatic(className, pair.second, classDescriptor);
blockCode->instrAreturn(); blockCode->instrAreturn();
blocks.emplace_back(pair.first, blockCode.get()); blocks.emplace_back(pair.first, blockCode.release());
blockCode.release();
} }
code->instrLookupswitch(defCode.get(), blocks); code->instrLookupswitch(defCode.get(), blocks);
for (const std::pair< sal_Int32, ClassFile::Code * >& pair : blocks) for (const std::pair< sal_Int32, ClassFile::Code * >& pair : blocks)