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

Public GIT Repository
model-checker : new function MC_take_snapshot_to_restore_liveness for the initial...
[simgrid.git] / src / mc / memory_map.c
index 16e8e02c3aed812b01ac0f18795a62f0e418f38a..1fe0b1ad955874f73cbfb3cdee427518780697d5 100644 (file)
@@ -22,6 +22,9 @@ memory_map_t get_memory_map(void)
 /* to be returned. */
   fp = fopen("/proc/self/maps", "r");
 
+  if(fp == NULL)
+    perror("fopen failed");
+
   xbt_assert(fp,
               "Cannot open /proc/self/maps to investigate the memory map of the process. Please report this bug.");
 
@@ -141,8 +144,9 @@ memory_map_t get_memory_map(void)
 
   }
 
-  if (line)
-    free(line);
+  free(line);
+
+  fclose(fp);
 
   return ret;
 }