修复创建ip_matcher时导致的内存泄漏。Close #22
This commit is contained in:
@@ -33,7 +33,7 @@
|
|||||||
#include "stream_fuzzy_hash.h"
|
#include "stream_fuzzy_hash.h"
|
||||||
#include "gram_index_engine.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)
|
int is_valid_table_name(const char* str)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -440,13 +440,13 @@ int Maat_table_runtime_ip_plugin_rebuild_ip_matcher(struct Maat_table_runtime* t
|
|||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
assert(i==rule_cnt);
|
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);
|
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.old_ip_matcher=table_rt->ip_plugin.ip_matcher;
|
||||||
table_rt->ip_plugin.ip_matcher=new_ip_matcher;
|
table_rt->ip_plugin.ip_matcher=new_ip_matcher;
|
||||||
|
}
|
||||||
|
free(rules);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
struct ip_matcher* Maat_table_runtime_dettach_old_ip_matcher(struct Maat_table_runtime* table_rt)
|
struct ip_matcher* Maat_table_runtime_dettach_old_ip_matcher(struct Maat_table_runtime* table_rt)
|
||||||
|
|||||||
Reference in New Issue
Block a user