全量更新时产生内存泄漏的bug进行自测。
This commit is contained in:
@@ -837,7 +837,7 @@ int build_serial_rule(_Maat_feather_t *feather,struct _Maat_cmd_inner_t* _cmd,st
|
|||||||
|
|
||||||
int rule_num=0,i=0,j=0;
|
int rule_num=0,i=0,j=0;
|
||||||
p_m_rule=&(cmd->compile);
|
p_m_rule=&(cmd->compile);
|
||||||
char line[1024];
|
char line[MAX_TABLE_LINE_SIZE];
|
||||||
time_t timeout=0;
|
time_t timeout=0;
|
||||||
if(_cmd->cmd.expire_after>0)
|
if(_cmd->cmd.expire_after>0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -863,6 +863,17 @@ struct _Maat_compile_inner_t * create_compile_rule(int compile_id)
|
|||||||
pthread_rwlock_init(&(p->rwlock), NULL);
|
pthread_rwlock_init(&(p->rwlock), NULL);
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
void force_destroy_compile_rule(struct _Maat_compile_inner_t * p)
|
||||||
|
{
|
||||||
|
p->compile_id=-1;
|
||||||
|
dynamic_array_destroy(p->groups,NULL);
|
||||||
|
if(p->db_c_rule!=NULL)
|
||||||
|
{
|
||||||
|
free(p->db_c_rule);
|
||||||
|
}
|
||||||
|
pthread_rwlock_destroy(&(p->rwlock));
|
||||||
|
free(p);
|
||||||
|
}
|
||||||
void destroy_compile_rule(struct _Maat_compile_inner_t * p)
|
void destroy_compile_rule(struct _Maat_compile_inner_t * p)
|
||||||
{
|
{
|
||||||
int i=0;
|
int i=0;
|
||||||
@@ -873,14 +884,7 @@ void destroy_compile_rule(struct _Maat_compile_inner_t * p)
|
|||||||
p_group=(struct _Maat_compile_inner_t*)dynamic_array_read(p->groups,i);
|
p_group=(struct _Maat_compile_inner_t*)dynamic_array_read(p->groups,i);
|
||||||
assert(p_group==NULL);
|
assert(p_group==NULL);
|
||||||
}
|
}
|
||||||
p->compile_id=-1;
|
force_destroy_compile_rule(p);
|
||||||
dynamic_array_destroy(p->groups,NULL);
|
|
||||||
if(p->db_c_rule!=NULL)
|
|
||||||
{
|
|
||||||
free(p->db_c_rule);
|
|
||||||
}
|
|
||||||
pthread_rwlock_destroy(&(p->rwlock));
|
|
||||||
free(p);
|
|
||||||
}
|
}
|
||||||
scan_rule_t* create_rs_str_rule(unsigned int sub_type,enum MAAT_MATCH_METHOD match_method,int is_case_sensitive,const char* string,int len,int l_offset,int r_offset)
|
scan_rule_t* create_rs_str_rule(unsigned int sub_type,enum MAAT_MATCH_METHOD match_method,int is_case_sensitive,const char* string,int len,int l_offset,int r_offset)
|
||||||
{
|
{
|
||||||
@@ -1154,7 +1158,7 @@ void destroy_maat_scanner(struct _Maat_scanner_t*scanner)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
rulescan_destroy(scanner->region);
|
rulescan_destroy(scanner->region);
|
||||||
MESA_htable_destroy(scanner->compile_hash,(void (*)(void*))destroy_compile_rule);
|
MESA_htable_destroy(scanner->compile_hash,(void (*)(void*))force_destroy_compile_rule);
|
||||||
MESA_htable_destroy(scanner->group_hash, (void (*)(void*))force_destroy_group_rule);
|
MESA_htable_destroy(scanner->group_hash, (void (*)(void*))force_destroy_group_rule);
|
||||||
MESA_htable_destroy(scanner->region_hash, NULL);
|
MESA_htable_destroy(scanner->region_hash, NULL);
|
||||||
map_destroy(scanner->district_map);
|
map_destroy(scanner->district_map);
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ typedef int atomic_t;
|
|||||||
#define MAX_CONJUNCTION_TABLE_NUM 8
|
#define MAX_CONJUNCTION_TABLE_NUM 8
|
||||||
#define MAX_CHARSET_NUM 16
|
#define MAX_CHARSET_NUM 16
|
||||||
#define MAX_TABLE_NAME_LEN 256
|
#define MAX_TABLE_NAME_LEN 256
|
||||||
#define MAX_TABLE_LINE_SIZE (1024*4)
|
#define MAX_TABLE_LINE_SIZE (1024*16)
|
||||||
#define MAX_EXPR_KEYLEN 1024
|
#define MAX_EXPR_KEYLEN 1024
|
||||||
#define MAX_DISTRICT_LEN 64
|
#define MAX_DISTRICT_LEN 64
|
||||||
#define MAX_PLUGING_NUM 32
|
#define MAX_PLUGING_NUM 32
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
#define CM_MAX_TABLE_NUM 256
|
#define CM_MAX_TABLE_NUM 256
|
||||||
#define MAX_CONFIG_FN_LEN 256
|
#define MAX_CONFIG_FN_LEN 256
|
||||||
#define MAX_CONFIG_LINE 1024*4
|
#define MAX_CONFIG_LINE (1024*16)
|
||||||
|
|
||||||
#ifndef MAX
|
#ifndef MAX
|
||||||
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
|
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
|
||||||
@@ -56,7 +56,7 @@ int decrypt_open(FILE* in,const unsigned char* key, const char* algorithm,unsign
|
|||||||
cipher=EVP_get_cipherbyname(algorithm);
|
cipher=EVP_get_cipherbyname(algorithm);
|
||||||
if(cipher==NULL)
|
if(cipher==NULL)
|
||||||
{
|
{
|
||||||
MESA_handle_runtime_log(logger,RLOG_LV_FATAL,module_config_monitor,"Not cipher:%s not supported.",algorithm);
|
MESA_handle_runtime_log(logger,RLOG_LV_FATAL,module_config_monitor,"Cipher %s is not supported.",algorithm);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
dgst=EVP_get_digestbyname("md5");
|
dgst=EVP_get_digestbyname("md5");
|
||||||
|
|||||||
Reference in New Issue
Block a user