diff --git a/libclamav/matcher-ac.c b/libclamav/matcher-ac.c index d882ddf39e..0d600033b4 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 3bd541e2d5..ab414be00f 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 5076e117e9..b8e7d786fc 100644 --- a/libclamav/readdb.c +++ b/libclamav/readdb.c @@ -4862,9 +4862,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;