Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Kill "if" before free, and useless cast of free argument.
[simgrid.git] / src / gras / DataDesc / cbps.c
index 4584b19..145560f 100644 (file)
@@ -94,7 +94,7 @@ gras_cbps_v_push(gras_cbps_t ps,
 
     XBT_DEBUG("Create a new variable stack for '%s' into the space", name);
     varstack = xbt_dynar_new(sizeof(gras_cbps_elm_t *), NULL);
-    xbt_dict_set(ps->space, varname, (void **) varstack, NULL);
+    xbt_dict_set(ps->space, name, (void **) varstack, NULL);
     xbt_ex_free(e);
     /* leaking, you think? only if you do not close all the openned blocks ;) */
   }
@@ -282,8 +282,7 @@ void gras_cbps_block_end(gras_cbps_t ps)
       xbt_dynar_free_container(&varstack);      /*already empty, save a test ;) */
     }
 
-    if (var->data)
-      free(var->data);
+    free(var->data);
     free(var);
     free(name);
   }