From 39a9cdb8b7338176c86c0d2fe9d1347233211312 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Wed, 23 Sep 2015 10:38:59 +0000 Subject: [PATCH] [dsymutil] Plug a memory leak. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248372 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/dsymutil/DwarfLinker.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/dsymutil/DwarfLinker.cpp b/tools/dsymutil/DwarfLinker.cpp index c45ff6a113d..fb7ffceec8f 100644 --- a/tools/dsymutil/DwarfLinker.cpp +++ b/tools/dsymutil/DwarfLinker.cpp @@ -3157,7 +3157,7 @@ void DwarfLinker::loadClangModule(StringRef Filename, StringRef ModulePath, // FIXME: At this point dsymutil should verify the DW_AT_gnu_dwo_id // against the module hash of the clang module. - CompileUnit *Unit = nullptr; + std::unique_ptr Unit; // Setup access to the debug info. DWARFContextInMemory DwarfContext(*ErrOrObj); @@ -3172,7 +3172,7 @@ void DwarfLinker::loadClangModule(StringRef Filename, StringRef ModulePath, << " 1 compile unit.\n"; exitDsymutil(1); } - Unit = new CompileUnit(*CU, UnitID++, !Options.NoODR); + Unit = llvm::make_unique(*CU, UnitID++, !Options.NoODR); Unit->setHasInterestingContent(); gatherDIEParents(CUDie, 0, *Unit, &ODRContexts.getRoot(), StringPool, ODRContexts); -- 2.34.1