From 8fd865af30b0d3ed8834a406ed953ad02b981340 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Mon, 28 Dec 2020 18:29:09 +0000 Subject: Fix leak of demangled test name --- gentoobrowse/src/test.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gentoobrowse/src/test.cpp b/gentoobrowse/src/test.cpp index 98dec8d..450239d 100644 --- a/gentoobrowse/src/test.cpp +++ b/gentoobrowse/src/test.cpp @@ -51,8 +51,9 @@ public: standardAssertions(const char * name) override { BOOST_TEST_CONTEXT(__FUNCTION__ << " : " << name) { - auto realname = abi::__cxa_demangle(name, 0, 0, nullptr); - const auto outputPath {(binDir / realname).replace_extension(".html")}; + auto realname + = std::unique_ptr {abi::__cxa_demangle(name, 0, 0, nullptr), std::free}; + const auto outputPath {(binDir / realname.get()).replace_extension(".html")}; std::ofstream {outputPath} << (output.str()); auto h = getResponseHeaders(); -- cgit v1.2.3