]> git.deb.at Git - pkg/abook.git/commitdiff
Fixed dangling pointers in database items after xrealloc'ing.
authorCedric Duval <cedricduval@free.fr>
Mon, 31 Oct 2005 06:24:13 +0000 (06:24 +0000)
committerCedric Duval <cedricduval@free.fr>
Mon, 31 Oct 2005 06:24:13 +0000 (06:24 +0000)
database.c

index 138b7f356abf18d1287a4480e025e3459986d27f..9dce1807392d51605172261a21837c35ab7dec79 100644 (file)
@@ -204,8 +204,10 @@ declare_unknown_field(char *key)
                return;
 
        for(i = 0; i < fields_count; i++)
-               if(database[i])
+               if(database[i]) {
                        database[i] = xrealloc(database[i], ITEM_SIZE);
+                       database[i][fields_count - 1] = NULL;
+               }
 }
 
 /*