Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Avoid to use the data after freeing them, even in error reporting
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Sun, 7 Aug 2005 17:46:40 +0000 (17:46 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Sun, 7 Aug 2005 17:46:40 +0000 (17:46 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@1619 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/xbt/config.c

index 6f42ce9..e6a802e 100644 (file)
@@ -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);