From: Cedric Duval Date: Mon, 31 Oct 2005 06:24:13 +0000 (+0000) Subject: Fixed dangling pointers in database items after xrealloc'ing. X-Git-Tag: upstream/0.6.1~2^2~124 X-Git-Url: https://git.deb.at/w?a=commitdiff_plain;h=092fbdb132cd39ab7f2a6584d19e97bb274143d2;p=pkg%2Fabook.git Fixed dangling pointers in database items after xrealloc'ing. --- diff --git a/database.c b/database.c index 138b7f3..9dce180 100644 --- a/database.c +++ b/database.c @@ -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; + } } /*