Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
model-checker : privatization_regions in snapshot may be NULL
authorMarion Guthmuller <marion.guthmuller@inria.fr>
Sat, 5 Apr 2014 17:22:13 +0000 (19:22 +0200)
committerMarion Guthmuller <marion.guthmuller@inria.fr>
Sat, 5 Apr 2014 17:22:13 +0000 (19:22 +0200)
src/mc/mc_checkpoint.c

index 92d7616..e455677 100644 (file)
@@ -67,11 +67,13 @@ void MC_free_snapshot(mc_snapshot_t snapshot){
   xbt_dynar_free(&(snapshot->stacks));
   xbt_dynar_free(&(snapshot->to_ignore));
 
   xbt_dynar_free(&(snapshot->stacks));
   xbt_dynar_free(&(snapshot->to_ignore));
 
-  size_t n = snapshot->nb_processes;
-  for(i=0; i!=n; ++i) {
-    MC_region_destroy(snapshot->privatization_regions[i]);
+  if(snapshot->privatization_regions){
+    size_t n = snapshot->nb_processes;
+    for(i=0; i!=n; ++i) {
+      MC_region_destroy(snapshot->privatization_regions[i]);
+    }
+    xbt_free(snapshot->privatization_regions);
   }
   }
-  xbt_free(snapshot->privatization_regions);
 
   xbt_free(snapshot);
 }
 
   xbt_free(snapshot);
 }