[Lldb-commits] [lldb] Free buffer to fix memory leak on test (PR #137979)

Ivan Tadeu Ferreira Antunes Filho via lldb-commits lldb-commits at lists.llvm.org
Wed Apr 30 08:28:05 PDT 2025


https://github.com/itf created https://github.com/llvm/llvm-project/pull/137979

None

>From 2949d9ab36b214137d9a60dc2a6eb88f9ba4a737 Mon Sep 17 00:00:00 2001
From: Ivan Tadeu Ferreira Antunes Filho <antunesi at google.com>
Date: Wed, 30 Apr 2025 11:26:16 -0400
Subject: [PATCH] Free bugger and fix memory leak on test

---
 lldb/unittests/Core/MangledTest.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lldb/unittests/Core/MangledTest.cpp b/lldb/unittests/Core/MangledTest.cpp
index aaca4270d708a..44651eb94c23b 100644
--- a/lldb/unittests/Core/MangledTest.cpp
+++ b/lldb/unittests/Core/MangledTest.cpp
@@ -605,6 +605,7 @@ TEST_P(DemanglingPartsTestFixture, DemanglingParts) {
   EXPECT_EQ(get_part(OB.NameInfo.BasenameRange), basename);
   EXPECT_EQ(get_part(OB.NameInfo.ScopeRange), scope);
   EXPECT_EQ(get_part(OB.NameInfo.QualifiersRange), qualifiers);
+  std::free(OB.getBuffer());
 }
 
 INSTANTIATE_TEST_SUITE_P(DemanglingPartsTests, DemanglingPartsTestFixture,



More information about the lldb-commits mailing list