[PATCH] D37321: llvm-mt: Fix release of OutputDoc
Vitaly Buka via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 30 18:16:46 PDT 2017
vitalybuka updated this revision to Diff 113347.
vitalybuka added a comment.
clang-format
https://reviews.llvm.org/D37321
Files:
lib/WindowsManifest/WindowsManifestMerger.cpp
Index: lib/WindowsManifest/WindowsManifestMerger.cpp
===================================================================
--- lib/WindowsManifest/WindowsManifestMerger.cpp
+++ lib/WindowsManifest/WindowsManifestMerger.cpp
@@ -652,11 +652,13 @@
xmlNodePtr CombinedRoot = xmlDocGetRootElement(CombinedDoc);
std::vector<xmlNsPtr> RequiredPrefixes;
checkAndStripPrefixes(CombinedRoot, RequiredPrefixes);
- std::unique_ptr<xmlDoc> OutputDoc(xmlNewDoc((const unsigned char *)"1.0"));
+ std::unique_ptr<xmlDoc, decltype(&xmlFreeDoc)> OutputDoc(
+ xmlNewDoc((const unsigned char *)"1.0"), &xmlFreeDoc);
xmlDocSetRootElement(OutputDoc.get(), CombinedRoot);
xmlKeepBlanksDefault(0);
xmlDocDumpFormatMemoryEnc(OutputDoc.get(), &XmlBuff, &BufferSize, "UTF-8",
1);
+ xmlDocSetRootElement(OutputDoc.get(), nullptr);
}
if (BufferSize == 0)
return nullptr;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D37321.113347.patch
Type: text/x-patch
Size: 928 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170831/5cb5071a/attachment.bin>
More information about the llvm-commits
mailing list