- asprintf(&key, "%d", index);
- xbt_dict_set(group->index_to_rank_map, key, val_rank, NULL);
- free(key);
+ int size = asprintf(&key, "%d", index);
+ if (size!=-1){
+ xbt_dict_set(group->index_to_rank_map, key, val_rank, NULL);
+ free(key);
+ } else {
+ xbt_die("could not allocate memory for asprintf");
+ }