diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2016-02-14 13:18:06 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2016-02-14 13:18:06 +0000 |
commit | c077371eb6feb59039ef906f7dc4c87a3ce4ba76 (patch) | |
tree | a89e09fa67f54a6486c183274cd18de65a385db3 /tools/c-index-test/core_main.cpp | |
parent | 3bbaf2441175dcdc0be3f2fbc1c2de664824b7cd (diff) | |
download | clang-c077371eb6feb59039ef906f7dc4c87a3ce4ba76.tar.gz |
Don't leak the ASTUnit when done with testing.
Found by lsan.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260850 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/c-index-test/core_main.cpp')
-rw-r--r-- | tools/c-index-test/core_main.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/tools/c-index-test/core_main.cpp b/tools/c-index-test/core_main.cpp index ce37b56256..c56d66f214 100644 --- a/tools/c-index-test/core_main.cpp +++ b/tools/c-index-test/core_main.cpp @@ -123,9 +123,8 @@ static bool printSourceSymbols(ArrayRef<const char *> Args) { /*WrappedAction=*/nullptr); auto PCHContainerOps = std::make_shared<PCHContainerOperations>(); - ASTUnit *Unit = - ASTUnit::LoadFromCompilerInvocationAction(CInvok.get(), PCHContainerOps, - Diags, IndexAction.get()); + std::unique_ptr<ASTUnit> Unit(ASTUnit::LoadFromCompilerInvocationAction( + CInvok.get(), PCHContainerOps, Diags, IndexAction.get())); if (!Unit) return true; |