Fix memory leak in demangling of string literals.
authorZachary Turner <zturner@google.com>
Thu, 16 Aug 2018 17:48:32 +0000 (17:48 +0000)
committerZachary Turner <zturner@google.com>
Thu, 16 Aug 2018 17:48:32 +0000 (17:48 +0000)
llvm-svn: 339909

llvm/lib/Demangle/MicrosoftDemangle.cpp

index bc1cada..4793ca8 100644 (file)
@@ -1762,6 +1762,7 @@ Name *Demangler::demangleStringLiteral(StringView &MangledName) {
   OS << '\0';
   ResultBuffer = OS.getBuffer();
   Result->Str = copyString(ResultBuffer);
+  std::free(ResultBuffer);
   return Result;
 
 StringLiteralError: