From: Willy Tarreau Date: Mon, 2 Dec 2013 23:48:45 +0000 (+0100) Subject: BUG/MINOR: http: usual deinit stuff in last commit X-Git-Tag: v1.5-dev20~175 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=60e0838f60bb941b61b1ed596027a8d70d9de8ba;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/src/proto_http.c b/src/proto_http.c index b0eba5e8fb..c91b109142 100644 --- a/src/proto_http.c +++ b/src/proto_http.c @@ -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