BUG/MINOR: http: usual deinit stuff in last commit

We need to initialize the rdr_fmt list inconditionally. Using only
a redirect rule without an http-redirect may cause a crash during
deinit because of the list iterating from null.
This commit is contained in:
Willy Tarreau 2013-12-03 00:48:45 +01:00
parent d18cd0f110
commit 60e0838f60

View File

@ -8804,6 +8804,7 @@ struct redirect_rule *http_parse_redirect_rule(const char *file, int linenum, st
rule = (struct redirect_rule *)calloc(1, sizeof(*rule));
rule->cond = cond;
LIST_INIT(&rule->rdr_fmt);
if (!use_fmt) {
/* old-style static redirect rule */
@ -8812,7 +8813,6 @@ struct redirect_rule *http_parse_redirect_rule(const char *file, int linenum, st
}
else {
/* log-format based redirect rule */
LIST_INIT(&rule->rdr_fmt);
/* Parse destination. Note that in the REDIRECT_TYPE_PREFIX case,
* if prefix == "/", we don't want to add anything, otherwise it