BUG/MINOR: http-rules: Always init log-format expr for common HTTP actions
Many HTTP actions rely on <.arg.http> in the act_rule structure. Not all actions
use the log-format expression, but it must be initialized anyway. Otherwise,
HAProxy may crash during the deinit when the release function is called.
No backport needed. This patch should fix issue #468.
diff --git a/src/http_act.c b/src/http_act.c
index a7f9e11..1632130 100644
--- a/src/http_act.c
+++ b/src/http_act.c
@@ -335,6 +335,7 @@
(*orig_arg)++;
}
+ LIST_INIT(&rule->arg.http.fmt);
return ACT_RET_PRS_OK;
}
@@ -928,6 +929,7 @@
cur_arg++;
}
+ LIST_INIT(&rule->arg.http.fmt);
*orig_arg = cur_arg;
return ACT_RET_PRS_OK;
}
@@ -953,6 +955,7 @@
else if (rule->arg.http.i > 1024)
rule->arg.http.i = 1024;
+ LIST_INIT(&rule->arg.http.fmt);
*orig_arg = cur_arg + 1;
return ACT_RET_PRS_OK;
}
@@ -980,6 +983,7 @@
return ACT_RET_PRS_ERR;
}
+ LIST_INIT(&rule->arg.http.fmt);
*orig_arg = cur_arg + 1;
return ACT_RET_PRS_OK;
#else
@@ -1011,6 +1015,7 @@
return ACT_RET_PRS_ERR;
}
+ LIST_INIT(&rule->arg.http.fmt);
*orig_arg = cur_arg + 1;
global.last_checks |= LSTCHK_NETADM;
return ACT_RET_PRS_OK;
@@ -1041,6 +1046,7 @@
else if ((rule->arg.http.i = get_log_level(args[cur_arg]) + 1) == 0)
goto bad_log_level;
+ LIST_INIT(&rule->arg.http.fmt);
*orig_arg = cur_arg + 1;
return ACT_RET_PRS_OK;
}
@@ -1372,6 +1378,7 @@
px->conf.args.ctx = (rule->from == ACT_F_HTTP_REQ ? ARGC_HRQ : ARGC_HRS);
+ LIST_INIT(&rule->arg.http.fmt);
*orig_arg = cur_arg + 1;
return ACT_RET_PRS_OK;
}