diff --git a/src/http_act.c b/src/http_act.c index 0a4d67cea..2adf6fcca 100644 --- a/src/http_act.c +++ b/src/http_act.c @@ -2005,6 +2005,8 @@ static enum act_parse_ret parse_http_set_map(const char **args, int *orig_arg, s } rule->action_ptr = http_action_set_map; rule->release_ptr = release_http_map; + lf_expr_init(&rule->arg.map.key); + lf_expr_init(&rule->arg.map.value); cur_arg = *orig_arg; if (rule->action == 1 && (!*args[cur_arg] || !*args[cur_arg+1])) { @@ -2040,7 +2042,6 @@ static enum act_parse_ret parse_http_set_map(const char **args, int *orig_arg, s } /* key pattern */ - lf_expr_init(&rule->arg.map.key); if (!parse_logformat_string(args[cur_arg], px, &rule->arg.map.key, LOG_OPT_NONE, cap, err)) { free(rule->arg.map.ref); return ACT_RET_PRS_ERR; @@ -2049,7 +2050,6 @@ static enum act_parse_ret parse_http_set_map(const char **args, int *orig_arg, s if (rule->action == 1) { /* value pattern for set-map only */ cur_arg++; - lf_expr_init(&rule->arg.map.value); if (!parse_logformat_string(args[cur_arg], px, &rule->arg.map.value, LOG_OPT_NONE, cap, err)) { free(rule->arg.map.ref); return ACT_RET_PRS_ERR;