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
This commit is contained in:
Nico Weber 2014-04-23 21:41:51 +00:00
parent 9e6a524551
commit 795f6a9d7c
2 changed files with 5 additions and 0 deletions

View File

@ -29,6 +29,7 @@ class CommentToXMLConverter {
public:
CommentToXMLConverter() : FormatContext(0), FormatInMemoryUniqueId(0) {}
~CommentToXMLConverter();
void convertCommentToHTML(const comments::FullComment *FC,
SmallVectorImpl<char> &HTML,

View File

@ -1136,6 +1136,10 @@ void CommentASTToXMLConverter::appendToResultWithCDATAEscaping(StringRef S) {
Result << "]]>";
}
CommentToXMLConverter::~CommentToXMLConverter() {
delete FormatContext;
}
void CommentToXMLConverter::convertCommentToHTML(const FullComment *FC,
SmallVectorImpl<char> &HTML,
const ASTContext &Context) {