Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
model-checker : memset forgotten in mmalloc
authorMarion Guthmuller <marion.guthmuller@loria.fr>
Thu, 20 Sep 2012 08:43:58 +0000 (10:43 +0200)
committerMarion Guthmuller <marion.guthmuller@loria.fr>
Fri, 5 Oct 2012 17:19:15 +0000 (19:19 +0200)
src/xbt/mmalloc/mmalloc.c

index e6f796d..f3f4b84 100644 (file)
@@ -289,6 +289,8 @@ void *mmalloc(xbt_mheap_t mdp, size_t size)
     mdp -> heapstats.chunks_used++;
     mdp -> heapstats.bytes_used += blocks * BLOCKSIZE;
     mdp -> heapstats.bytes_free -= blocks * BLOCKSIZE;
     mdp -> heapstats.chunks_used++;
     mdp -> heapstats.bytes_used += blocks * BLOCKSIZE;
     mdp -> heapstats.bytes_free -= blocks * BLOCKSIZE;
+
+    memset(result, 0, requested_size);
   }
   //printf("(%s) Done mallocing. Result is %p\n",xbt_thread_self_name(),result);fflush(stdout);
   return (result);
   }
   //printf("(%s) Done mallocing. Result is %p\n",xbt_thread_self_name(),result);fflush(stdout);
   return (result);