From 82fbf490b56e0b070cbcfaf1568c496340cd6e8a Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Mon, 22 Dec 2014 21:38:59 +0100 Subject: [PATCH] cmCTestTestHandler: take reference to temporary string instead of doing a copy This will increase the lifetime of the temporary until the end of the function. --- Source/CTest/cmCTestTestHandler.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index f330e584b..a058501f2 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -1317,7 +1317,7 @@ void cmCTestTestHandler::AttachFiles(std::ostream& os, result->Properties->AttachedFiles.begin(); file != result->Properties->AttachedFiles.end(); ++file) { - std::string base64 = this->CTest->Base64GzipEncodeFile(*file); + const std::string &base64 = this->CTest->Base64GzipEncodeFile(*file); std::string fname = cmSystemTools::GetFilenameName(*file); os << "\t\t"