Skip to content

Commit 2cfcbe2

Browse files
committed
[LLDB][NFC] Fix possible resource leak
SymbolVendorPECOFF object is leaked on early return at line 110 Differential Revision: https://reviews.llvm.org/D130655
1 parent 89d3c96 commit 2cfcbe2

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lldb/source/Plugins/SymbolVendor/PECOFF/SymbolVendorPECOFF.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,6 @@ SymbolVendorPECOFF::CreateInstance(const lldb::ModuleSP &module_sp,
102102
// This objfile is for debugging purposes.
103103
dsym_objfile_sp->SetType(ObjectFile::eTypeDebugInfo);
104104

105-
SymbolVendorPECOFF *symbol_vendor = new SymbolVendorPECOFF(module_sp);
106-
107105
// Get the module unified section list and add our debug sections to
108106
// that.
109107
SectionList *module_section_list = module_sp->GetSectionList();
@@ -132,6 +130,7 @@ SymbolVendorPECOFF::CreateInstance(const lldb::ModuleSP &module_sp,
132130
}
133131
}
134132

133+
SymbolVendorPECOFF *symbol_vendor = new SymbolVendorPECOFF(module_sp);
135134
symbol_vendor->AddSymbolFileRepresentation(dsym_objfile_sp);
136135
return symbol_vendor;
137136
}

0 commit comments

Comments
 (0)