]> AND Public Git Repository - simgrid.git/blobdiff - src/xbt/heap.c
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
I should try to compile before comiting. Sorry.
[simgrid.git] / src / xbt / heap.c
index 96da93ec1790deff20cffefe0203c2242cfb4e90..5bfca96009a0b9e79005aad1dccc7abe7c3eaf93 100644 (file)
@@ -53,13 +53,14 @@ inline void xbt_heap_set_update_callback(xbt_heap_t H, void (*update_callback) (
  */
 void xbt_heap_free(xbt_heap_t H)
 {
-  int i;
+  if (!H)
+    return;
+
   if (H->free)
-    for (i = 0; i < H->count; i++)
+    for (int i = 0; i < H->count; i++)
       H->free(H->items[i].content);
   free(H->items);
   free(H);
-  return;
 }
 
 /**