strdup not hex2str for tokens[3]!

git-svn-id: file:///var/lib/svn/clamav-devel/branches/mpool@4272 77e5149b-7576-45b1-b177-96237e5ba77b
0.95
Török Edvin 17 years ago
parent a5746c2512
commit e309658f9b
  1. 4
      ChangeLog
  2. 12
      libclamav/readdb.c

@ -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)

@ -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) {

Loading…
Cancel
Save