diff --git a/ChangeLog b/ChangeLog index 54d9927f6..a580b79d3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Sun Oct 19 14:13:48 EEST 2008 (edwin) +------------------------------------- + * libclamav/readdb.c: strdup not hex2str for tokens[3]! + Thu Oct 16 11:02:38 CEST 2008 (tk) ---------------------------------- * freshclam/manager.c: fix compilation error on systems without IPv6 (bb#1237) diff --git a/libclamav/readdb.c b/libclamav/readdb.c index 26210ea5f..a228c0c21 100644 --- a/libclamav/readdb.c +++ b/libclamav/readdb.c @@ -1270,15 +1270,8 @@ static int cli_loadftm(FILE *fs, struct cl_engine **engine, unsigned int options } new->length = strlen(tokens[2]) / 2; #ifdef USE_MPOOL -{ - unsigned char *mpooltname = cli_hex2str(tokens[3]); - if(mpooltname) { - unsigned int mpooltnamesz = strlen(tokens[3]) / 2 + 1; - if((new->tname = mpool_alloc((*engine)->mempool, mpooltnamesz, NULL))) - memcpy(new->tname, mpooltname, mpooltnamesz); - free(mpooltname); - } else new->tname = NULL; -} + if((new->tname = mpool_alloc((*engine)->mempool, strlen(tokens[3])+1, NULL))) + strcpy(new->tname, tokens[3]); #else new->tname = cli_strdup(tokens[3]); #endif @@ -2461,6 +2454,7 @@ void cl_free(struct cl_engine *engine) #endif #ifdef USE_MPOOL + printf("here\n"); if(engine->mempool) mpool_close(engine->mempool); #else if(engine->root) {