summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2020-12-28 18:29:09 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2020-12-28 18:29:09 +0000
commit8fd865af30b0d3ed8834a406ed953ad02b981340 (patch)
tree75598c4c83eacfc20e88078523baadc9d2128c51
parentTweaks to improve diagnostic output (diff)
downloadgentoobrowse-2.1.5.tar.bz2
gentoobrowse-2.1.5.tar.xz
gentoobrowse-2.1.5.zip
Fix leak of demangled test namegentoobrowse-2.1.5
-rw-r--r--gentoobrowse/src/test.cpp5
1 files 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<char, decltype(&std::free)> {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();