修复删除FQDN Plugin配置时产生的内存泄露。

This commit is contained in:
zhengchao
2020-10-19 16:11:25 +08:00
parent 331e1a6380
commit dda54b519e
3 changed files with 9 additions and 4 deletions

View File

@@ -775,6 +775,12 @@ static struct bool_matcher* Maat_hierarchy_build_bool_matcher(struct Maat_hierar
//STEP 3, serial clause states to a bool expression array.
compile_num=HASH_COUNT(hier->hash_compile_by_id);
if(compile_num==0)
{
MESA_handle_runtime_log(hier->logger, RLOG_LV_FATAL, module_maat_hierarchy,
"No compile to build.");
return NULL;
}
bool_expr_array=ALLOC(struct bool_expr, compile_num);
HASH_ITER(hh, hier->hash_compile_by_id, compile, tmp_compile)
{
@@ -806,7 +812,7 @@ static struct bool_matcher* Maat_hierarchy_build_bool_matcher(struct Maat_hierar
if(expr_cnt==0)
{
MESA_handle_runtime_log(hier->logger, RLOG_LV_FATAL, module_maat_hierarchy,
"No expr to build.");
"No bool expression to build.");
return NULL;
}
bm=bool_matcher_new(bool_expr_array, expr_cnt, hier->thread_num, &mem_size);