From 0090ea7fd5569795fcbbc08b481d593a9355cd4a Mon Sep 17 00:00:00 2001 From: degomme Date: Wed, 13 Jul 2016 10:28:54 +0200 Subject: [PATCH] Copy the name of the "file", as we don't know where it comes from. If it's not generated by __FILE__ (fortran, for example), it may be destroyed too soon. This can cause a leak, I will see to that later --- src/smpi/smpi_bench.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/smpi/smpi_bench.cpp b/src/smpi/smpi_bench.cpp index 964e4e2c66..adbbd3d441 100644 --- a/src/smpi/smpi_bench.cpp +++ b/src/smpi/smpi_bench.cpp @@ -98,10 +98,10 @@ namespace { class smpi_source_location { public: smpi_source_location(const char* filename, int line) - : filename(filename), filename_length(strlen(filename)), line(line) {} + : filename(xbt_strdup(filename)), filename_length(strlen(filename)), line(line) {} /** Pointer to a static string containing the file name */ - const char* filename = nullptr; + char* filename = nullptr; int filename_length = 0; int line = 0; -- 2.20.1