From dbae8cdb89bc876b1c56a051d90ab3dbd4732663 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Mon, 23 Jul 2018 18:21:43 +0000 Subject: [PATCH] [Demangle] Attempt to fix arena memory leak llvm-svn: 337720 --- llvm/lib/Demangle/MicrosoftDemangle.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/llvm/lib/Demangle/MicrosoftDemangle.cpp b/llvm/lib/Demangle/MicrosoftDemangle.cpp index c89f0cf..a89ced2 100644 --- a/llvm/lib/Demangle/MicrosoftDemangle.cpp +++ b/llvm/lib/Demangle/MicrosoftDemangle.cpp @@ -42,7 +42,9 @@ public: while (Head) { assert(Head->Buf); delete[] Head->Buf; - Head = Head->Next; + AllocatorNode *Next = Head->Next; + delete Head; + Head = Next; } } -- 2.7.4