diff options
| author | 刘学利 <[email protected]> | 2021-04-01 02:28:12 +0000 |
|---|---|---|
| committer | 刘学利 <[email protected]> | 2021-04-01 02:28:12 +0000 |
| commit | 912749b1cdd25925349cdec3ca125a47ec70fdcf (patch) | |
| tree | 390da795f2a83aae12397cec898c978703fdb615 | |
| parent | f82454a310ea05fbc6b077697c1586a345e4a78f (diff) | |
Fix memory leak by update uncare tablev3.1.17
| -rw-r--r-- | src/entry/Maat_hierarchy.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/entry/Maat_hierarchy.cpp b/src/entry/Maat_hierarchy.cpp index 6740621..45d93d9 100644 --- a/src/entry/Maat_hierarchy.cpp +++ b/src/entry/Maat_hierarchy.cpp @@ -904,10 +904,10 @@ static struct bool_matcher* Maat_hierarchy_build_bool_matcher(struct Maat_hierar //STEP 4, build the bool matcher. size_t mem_size=0; if(expr_cnt==0) - { + { MESA_handle_runtime_log(hier->logger, RLOG_LV_FATAL, module_maat_hierarchy, "No bool expression to build."); - return NULL; + goto error_out; } bm=bool_matcher_new(bool_expr_array, expr_cnt, hier->thread_num, &mem_size); if(bm!=NULL) @@ -929,8 +929,12 @@ static struct bool_matcher* Maat_hierarchy_build_bool_matcher(struct Maat_hierar { HASH_DELETE(hh, clause_dedup_hash, clause_entry); } +error_out: free(clause_entry_array); + clause_entry_array=NULL; + free(bool_expr_array); + bool_expr_array=NULL; return bm; } |
