static xbt_cfgelm_t xbt_cfgelm_get(xbt_cfg_t cfg,
const char *name,
e_xbt_cfgelm_type_t type){
- xbt_cfgelm_t res;
+ xbt_cfgelm_t res=NULL;
xbt_ex_t e;
TRY {
char *str;
int i;
double d;
- e_xbt_cfgelm_type_t type;
+ e_xbt_cfgelm_type_t type=0; /* Set a dummy value to make gcc happy. It cannot get uninitialized */
xbt_ex_t e;
double d;
char *str;
- xbt_cfgelm_t variable;
+ xbt_cfgelm_t variable=NULL;
char *optionlist_cpy;
char *option, *name,*val;
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);
void
xbt_cfg_empty(xbt_cfg_t cfg,const char*name) {
- xbt_cfgelm_t variable;
+ xbt_cfgelm_t variable=NULL;
xbt_ex_t e;
TRY {
* \warning the returned value is the actual content of the config set
*/
xbt_dynar_t xbt_cfg_get_dynar (xbt_cfg_t cfg, const char *name) {
- xbt_cfgelm_t variable;
+ xbt_cfgelm_t variable=NULL;
xbt_ex_t e;
TRY {