From 795f6a9d7cca4ee0b3165d889ef52152a5ea389d Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Wed, 23 Apr 2014 21:41:51 +0000 Subject: Fix leak introduced in r194610, found by LSan. LSan folks: LSan pointed to #0 0x4953e0 in operator new[](unsigned long) llvm/projects/compiler-rt/lib/asan/asan_new_delete.cc:64 #1 0x7fb82af5372f in clang::RewriteRope::MakeRopeString(char const*, char const*) llvm/tools/clang/lib/Rewrite/Core/RewriteRope.cpp:796 instead of to the actual leak, which made tracking this down slower than it could have been. llvm-svn: 207031 --- clang/lib/Index/CommentToXML.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'clang/lib/Index/CommentToXML.cpp') diff --git a/clang/lib/Index/CommentToXML.cpp b/clang/lib/Index/CommentToXML.cpp index 4f5c0745d72..54087bd87d7 100644 --- a/clang/lib/Index/CommentToXML.cpp +++ b/clang/lib/Index/CommentToXML.cpp @@ -1136,6 +1136,10 @@ void CommentASTToXMLConverter::appendToResultWithCDATAEscaping(StringRef S) { Result << "]]>"; } +CommentToXMLConverter::~CommentToXMLConverter() { + delete FormatContext; +} + void CommentToXMLConverter::convertCommentToHTML(const FullComment *FC, SmallVectorImpl &HTML, const ASTContext &Context) { -- cgit v1.2.3