From 8f5f6084267adcae5f4e1279b936f5e1a9c72cbf Mon Sep 17 00:00:00 2001 From: fc_botelho Date: Fri, 2 Sep 2005 17:31:23 +0000 Subject: [PATCH] Fixed: gcc 2.95 problem and initialzes memory --- src/chm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/chm.c b/src/chm.c index 89648d8..3458577 100644 --- a/src/chm.c +++ b/src/chm.c @@ -19,14 +19,15 @@ static void chm_traverse(chm_config_data_t *chm, cmph_uint8 *visited, cmph_uint3 chm_config_data_t *chm_config_new() { - chm_config_data_t *chm = NULL; + chm_config_data_t *chm; chm = (chm_config_data_t *)malloc(sizeof(chm_config_data_t)); + assert(chm); + memset(chm,0,sizeof(chm_config_data_t)); chm->hashfuncs[0] = CMPH_HASH_JENKINS; chm->hashfuncs[1] = CMPH_HASH_JENKINS; chm->g = NULL; chm->graph = NULL; chm->hashes = NULL; - assert(chm); return chm; } void chm_config_destroy(cmph_config_t *mph)