From: Martin Quinson Date: Sun, 17 Apr 2016 09:06:02 +0000 (+0200) Subject: plug a memleak X-Git-Tag: v3_13~88 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/2889cfd6832bf3e721b22639f8ed06aef6da734a?hp=216273c918f52e722e4d3296b4d0ebd216bfd495;ds=sidebyside plug a memleak --- diff --git a/src/simgrid/sg_config.cpp b/src/simgrid/sg_config.cpp index 15e6ad35da..98142d3d58 100644 --- a/src/simgrid/sg_config.cpp +++ b/src/simgrid/sg_config.cpp @@ -323,9 +323,11 @@ static void _sg_cfg_cb__test_sleep(const char *name){ /* callback of the inclusion path */ static void _sg_cfg_cb__surf_path(const char *name) { - char *path = xbt_strdup(xbt_cfg_get_string(name)); - if (path[0]) // ignore "" + char *path = xbt_cfg_get_string(name); + if (path[0]) {// ignore "" + path = xbt_strdup(path); xbt_dynar_push(surf_path, &path); + } } /* callback to decide if we want to use the model-checking */