From 5c304dfe14d6fd7e63d67a84af42120b5a0c23cb Mon Sep 17 00:00:00 2001 From: zhengchao Date: Fri, 5 Jun 2020 10:24:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=9B=E5=BB=BAip=5Fmatche?= =?UTF-8?q?r=E6=97=B6=E5=AF=BC=E8=87=B4=E7=9A=84=E5=86=85=E5=AD=98?= =?UTF-8?q?=E6=B3=84=E6=BC=8F=E3=80=82Close=20#22?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/entry/Maat_rule.cpp | 2 +- src/entry/Maat_table_runtime.cpp | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/entry/Maat_rule.cpp b/src/entry/Maat_rule.cpp index ee19905..e151fa7 100644 --- a/src/entry/Maat_rule.cpp +++ b/src/entry/Maat_rule.cpp @@ -33,7 +33,7 @@ #include "stream_fuzzy_hash.h" #include "gram_index_engine.h" -int MAAT_FRAME_VERSION_2_9_20200513=1; +int MAAT_FRAME_VERSION_2_9_20200605=1; int is_valid_table_name(const char* str) { diff --git a/src/entry/Maat_table_runtime.cpp b/src/entry/Maat_table_runtime.cpp index accdc83..74718b7 100644 --- a/src/entry/Maat_table_runtime.cpp +++ b/src/entry/Maat_table_runtime.cpp @@ -440,13 +440,13 @@ int Maat_table_runtime_ip_plugin_rebuild_ip_matcher(struct Maat_table_runtime* t i++; } assert(i==rule_cnt); - if(rule_cnt==0) + if(rule_cnt>0) { - return 0; + new_ip_matcher=ip_matcher_new(rules, rule_cnt, &mem_use); + table_rt->ip_plugin.old_ip_matcher=table_rt->ip_plugin.ip_matcher; + table_rt->ip_plugin.ip_matcher=new_ip_matcher; } - new_ip_matcher=ip_matcher_new(rules, rule_cnt, &mem_use); - table_rt->ip_plugin.old_ip_matcher=table_rt->ip_plugin.ip_matcher; - table_rt->ip_plugin.ip_matcher=new_ip_matcher; + free(rules); return 0; } struct ip_matcher* Maat_table_runtime_dettach_old_ip_matcher(struct Maat_table_runtime* table_rt)