From: mquinson Date: Sun, 7 Aug 2005 17:46:40 +0000 (+0000) Subject: Avoid to use the data after freeing them, even in error reporting X-Git-Tag: v3.3~3737 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/3a5692bb27e561f7ae39e7a8e8bd1a29cd989884 Avoid to use the data after freeing them, even in error reporting git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@1619 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/src/xbt/config.c b/src/xbt/config.c index 6f42ce93b6..e6a802e9dd 100644 --- a/src/xbt/config.c +++ b/src/xbt/config.c @@ -575,6 +575,8 @@ xbt_cfg_set_parse(xbt_cfg_t cfg, const char *options) { TRY { variable = xbt_dict_get((xbt_dict_t)cfg,name); } CATCH(e) { + /* put it back on what won't get freed, ie within "options" and out of "optionlist_cpy" */ + name = (char*) (optionlist_cpy-name + options); free(optionlist_cpy); if (e.category == not_found_error) { xbt_ex_free(e);