From dbd07fadae4701ff2fec6fbee38dbedc1625290d Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Thu, 24 Apr 2014 04:58:41 +0000 Subject: Fix two leaks found by LSan (one is test-only). The result of llvm::MemoryBuffer::getMemBuffer() needs to be freed. Don't pass "don't free" flag to overrideFileContents() to fix. llvm-svn: 207075 --- clang/unittests/Tooling/RewriterTestContext.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/unittests/Tooling') diff --git a/clang/unittests/Tooling/RewriterTestContext.h b/clang/unittests/Tooling/RewriterTestContext.h index a1bb2311c55..f02ba1a9ffb 100644 --- a/clang/unittests/Tooling/RewriterTestContext.h +++ b/clang/unittests/Tooling/RewriterTestContext.h @@ -52,7 +52,7 @@ class RewriterTestContext { llvm::MemoryBuffer::getMemBuffer(Content); const FileEntry *Entry = Files.getVirtualFile(Name, Source->getBufferSize(), 0); - Sources.overrideFileContents(Entry, Source, true); + Sources.overrideFileContents(Entry, Source); assert(Entry != NULL); return Sources.createFileID(Entry, SourceLocation(), SrcMgr::C_User); } -- cgit v1.2.3