]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: http: usual deinit stuff in last commit
authorWilly Tarreau <w@1wt.eu>
Mon, 2 Dec 2013 23:48:45 +0000 (00:48 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 2 Dec 2013 23:48:45 +0000 (00:48 +0100)
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.

src/proto_http.c

index b0eba5e8fbed3a03256809b0e97efa8cf0b7679d..c91b109142b914d1d54d94f99ab3f5cc54f4e8c4 100644 (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