From: Frederic Suter Date: Thu, 20 Jul 2017 07:41:18 +0000 (+0200) Subject: char* to string == free-- X-Git-Tag: v3_17~360 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/f4417e41e71fcf25feb676ae7ab0e00823d54add char* to string == free-- --- diff --git a/src/surf/surf_interface.cpp b/src/surf/surf_interface.cpp index cf5f486fa7..cc313a1364 100644 --- a/src/surf/surf_interface.cpp +++ b/src/surf/surf_interface.cpp @@ -161,9 +161,8 @@ FILE *surf_fopen(const char *name, const char *mode) /* search relative files in the path */ for (auto path_elm : surf_path) { - char* buff = bprintf("%s" FILE_DELIM "%s", path_elm.c_str(), name); - file = fopen(buff, mode); - free(buff); + std::string buff = path_elm + FILE_DELIM + name; + file = fopen(buff.c_str(), mode); if (file) return file;