diff --git a/libclamav/matcher-ac.c b/libclamav/matcher-ac.c index 2ae8cdda19..708f79a458 100644 --- a/libclamav/matcher-ac.c +++ b/libclamav/matcher-ac.c @@ -2951,6 +2951,7 @@ cl_error_t cli_ac_addsig(struct cli_matcher *root, const char *virname, const ch cli_warnmsg("cli_ac_addsig: cannot use filter for trie\n"); MPOOL_FREE(root->mempool, root->filter); root->filter = NULL; + return CL_EMALFDB; } /* TODO: should this affect maxpatlen? */ diff --git a/libclamav/matcher-bm.c b/libclamav/matcher-bm.c index d4943bf30e..eb914f8caf 100644 --- a/libclamav/matcher-bm.c +++ b/libclamav/matcher-bm.c @@ -72,6 +72,7 @@ cl_error_t cli_bm_addpatt(struct cli_matcher *root, struct cli_bm_patt *pattern, cli_warnmsg("cli_bm_addpatt: cannot use filter for trie\n"); MPOOL_FREE(root->mempool, root->filter); root->filter = NULL; + return CL_EMALFDB; } /* TODO: should this affect maxpatlen? */ } diff --git a/libclamav/readdb.c b/libclamav/readdb.c index fc4ca4d108..da4861d448 100644 --- a/libclamav/readdb.c +++ b/libclamav/readdb.c @@ -4875,9 +4875,11 @@ cl_error_t cli_load(const char *filename, struct cl_engine *engine, unsigned int if (fs) fclose(fs); - if (engine->cb_sigload_progress) { - /* Let the progress callback function know how we're doing */ - (void)engine->cb_sigload_progress(engine->num_total_signatures, *signo, engine->cb_sigload_progress_ctx); + if (CL_SUCCESS == ret) { + if (engine->cb_sigload_progress) { + /* Let the progress callback function know how we're doing */ + (void)engine->cb_sigload_progress(engine->num_total_signatures, *signo, engine->cb_sigload_progress_ctx); + } } return ret;