diff --git a/src/entry/Maat_command.cpp b/src/entry/Maat_command.cpp index dfe2b5f..5afd085 100644 --- a/src/entry/Maat_command.cpp +++ b/src/entry/Maat_command.cpp @@ -368,6 +368,8 @@ int get_rm_key_list(unsigned int version,redisContext *c,struct serial_rule_t** if(reply->type==REDIS_REPLY_NIL||reply->type==REDIS_REPLY_ERROR) { MESA_handle_runtime_log(logger, RLOG_LV_FATAL, maat_redis_monitor,"GET MAAT_VERSION failed, maybe Redis is busy."); + freeReplyObject(reply); + reply=NULL; return -1; } } diff --git a/src/entry/json2iris.cpp b/src/entry/json2iris.cpp index ffc16aa..1e042a2 100644 --- a/src/entry/json2iris.cpp +++ b/src/entry/json2iris.cpp @@ -676,8 +676,10 @@ int write_compile_rule(cJSON *compile,struct iris_description_t *p_iris,void * l compile_cmd[cmd_cnt].json_type=cJSON_Number; cmd_cnt++; - compile_cmd[cmd_cnt].json_string="effective_rage"; + compile_cmd[cmd_cnt].json_string="effective_range"; compile_cmd[cmd_cnt].json_type=cJSON_Number; + compile_cmd[cmd_cnt].empty_allowed=1; + compile_cmd[cmd_cnt].default_int=0; cmd_cnt++; compile_cmd[cmd_cnt].json_string="user_region"; diff --git a/test/maat_json.json b/test/maat_json.json index 2363f48..410b51f 100644 --- a/test/maat_json.json +++ b/test/maat_json.json @@ -8,7 +8,7 @@ "action": 1, "do_blacklist": 1, "do_log": 1, - "effective_rage": 0, + "effective_range": 0, "user_region": "anything", "is_valid": "yes", "groups": [ @@ -74,7 +74,7 @@ "action": 1, "do_blacklist": 1, "do_log": 1, - "effective_rage": 0, + "effective_range": 0, "user_region": "anything", "is_valid": "yes", "groups": [ @@ -102,7 +102,7 @@ "action": 1, "do_blacklist": 1, "do_log": 1, - "effective_rage": 0, + "effective_range": 0, "user_region": "anything", "is_valid": "yes", "groups": [ @@ -128,7 +128,7 @@ "action": 1, "do_blacklist": 1, "do_log": 1, - "effective_rage": 0, + "effective_range": 0, "user_region": "anything", "is_valid": "yes", "groups": [ @@ -168,7 +168,7 @@ "action": 1, "do_blacklist": 1, "do_log": 1, - "effective_rage": 0, + "effective_range": 0, "user_region": "anything", "is_valid": "yes", "groups": [ @@ -194,7 +194,7 @@ "action": 1, "do_blacklist": 1, "do_log": 1, - "effective_rage": 0, + "effective_range": 0, "user_region": "anything", "is_valid": "yes", "groups": [ @@ -222,7 +222,7 @@ "action": 1, "do_blacklist": 1, "do_log": 1, - "effective_rage": 0, + "effective_range": 0, "user_region": "utf8_中文", "is_valid": "yes", "groups": [ @@ -249,7 +249,7 @@ "action": 1, "do_blacklist": 1, "do_log": 1, - "effective_rage": 0, + "effective_range": 0, "user_region": "utf8_维语", "is_valid": "yes", "groups": [ @@ -276,7 +276,7 @@ "action": 1, "do_blacklist": 1, "do_log": 1, - "effective_rage": 0, + "effective_range": 0, "user_region": "utf8_维语2", "is_valid": "yes", "groups": [ @@ -303,7 +303,7 @@ "action": 1, "do_blacklist": 1, "do_log": 1, - "effective_rage": 0, + "effective_range": 0, "user_region": "string\\bunescape", "is_valid": "yes", "groups": [ @@ -330,7 +330,7 @@ "action": 1, "do_blacklist": 1, "do_log": 1, - "effective_rage": 0, + "effective_range": 0, "user_region": "table_conjunction_test_part1", "is_valid": "yes", "groups": [ @@ -357,7 +357,7 @@ "action": 1, "do_blacklist": 1, "do_log": 1, - "effective_rage": 0, + "effective_range": 0, "user_region": "table_conjunction_test_part2", "is_valid": "yes", "groups": [ @@ -384,7 +384,7 @@ "action": 1, "do_blacklist": 1, "do_log": 1, - "effective_rage": 0, + "effective_range": 0, "user_region": "anything", "is_valid": "yes", "groups": [ diff --git a/test/maat_test.cpp b/test/maat_test.cpp index 1b3f9d4..51dbec9 100644 --- a/test/maat_test.cpp +++ b/test/maat_test.cpp @@ -499,7 +499,7 @@ void test_set_cmd_line(Maat_feather_t feather) char table_line[TEST_CMD_LINE_NUM][128]; int ret=0,i=0; memset(&line_rule,0,sizeof(line_rule)); - for(i=0;i<4;i++) + for(i=0;i