[PATCH] D100843: Fix memory leak in MicrosoftDemangleNodes's Node::toString
Raphael Isemann via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 22 09:44:59 PDT 2021
This revision was automatically updated to reflect the committed changes.
Closed by commit rGae209aa9ecd7: Fix memory leak in MicrosoftDemangleNodes's Node::toString (authored by teemperor).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D100843/new/
https://reviews.llvm.org/D100843
Files:
llvm/lib/Demangle/MicrosoftDemangleNodes.cpp
Index: llvm/lib/Demangle/MicrosoftDemangleNodes.cpp
===================================================================
--- llvm/lib/Demangle/MicrosoftDemangleNodes.cpp
+++ llvm/lib/Demangle/MicrosoftDemangleNodes.cpp
@@ -120,7 +120,9 @@
initializeOutputStream(nullptr, nullptr, OS, 1024);
this->output(OS, Flags);
OS << '\0';
- return {OS.getBuffer()};
+ std::string Owned(OS.getBuffer());
+ std::free(OS.getBuffer());
+ return Owned;
}
void PrimitiveTypeNode::outputPre(OutputStream &OS, OutputFlags Flags) const {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D100843.339687.patch
Type: text/x-patch
Size: 534 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210422/b2184af7/attachment.bin>
More information about the llvm-commits
mailing list