Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
model-checker : fix detection of dangling pointers in system state comparison
[simgrid.git] / src / smpi / smpi_bench.c
index 6e0b409..e5aa423 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007, 2009-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -117,6 +117,7 @@ static void* shm_map(int fd, size_t size, shared_data_t* data) {
 void smpi_bench_destroy(void)
 {
   xbt_dict_free(&allocs);
+  xbt_dict_free(&allocs_metadata);
   xbt_dict_free(&samples);
   xbt_dict_free(&calls);
 }
@@ -389,6 +390,7 @@ void *smpi_shared_malloc(size_t size, const char *file, int line)
       xbt_dict_set(allocs, loc, data, NULL);
       XBT_DEBUG("Mapping %s at %p through %d", loc, mem, fd);
     } else {
+      xbt_free(loc);
       mem = shm_map(data->fd, size, data);
       data->count++;
     }