Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
model-checker : initialize pointers (segfault with free)
authorMarion Guthmuller <marion.guthmuller@loria.fr>
Sat, 2 Jun 2012 15:00:53 +0000 (17:00 +0200)
committerMarion Guthmuller <marion.guthmuller@loria.fr>
Sat, 2 Jun 2012 15:00:53 +0000 (17:00 +0200)
src/mc/mc_liveness.c

index 241baab..08ee45f 100644 (file)
@@ -91,7 +91,7 @@ int data_program_region_compare(void *d1, void *d2, size_t size){
   int distance = 0;
   int pointer_align;
   int i;
   int distance = 0;
   int pointer_align;
   int i;
-  char *pointed_address1, *pointed_address2;
+  char *pointed_address1 = NULL, *pointed_address2 = NULL;
   
   for(i=0; i<size; i++){
     if(memcmp(((char *)d1) + i, ((char *)d2) + i, 1) != 0){
   
   for(i=0; i<size; i++){
     if(memcmp(((char *)d1) + i, ((char *)d2) + i, 1) != 0){
@@ -117,7 +117,7 @@ int data_libsimgrid_region_compare(void *d1, void *d2, size_t size){
   int distance = 0;
   int pointer_align;
   int i;
   int distance = 0;
   int pointer_align;
   int i;
-  char *pointed_address1, *pointed_address2;
+  char *pointed_address1 = NULL, *pointed_address2 = NULL;
   
   for(i=0; i<size; i++){
     if(memcmp(((char *)d1) + i, ((char *)d2) + i, 1) != 0){
   
   for(i=0; i<size; i++){
     if(memcmp(((char *)d1) + i, ((char *)d2) + i, 1) != 0){