]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: proxy: missing free in free_proxy for redirect rules
authorAurelien DARRAGON <adarragon@haproxy.com>
Thu, 11 May 2023 10:36:32 +0000 (12:36 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 11 May 2023 13:37:04 +0000 (15:37 +0200)
cookie_str from struct redirect, which may be allocated through
http_parse_redirect_rule() function is not properly freed on proxy
cleanup within free_proxy().

This could be backported to all stable versions.

[for 2.2, free_proxy() did not exist so the fix needs to be performed
directly in deinit() function from haproxy.c]

src/proxy.c

index b614e345bd34d49c249d18825ebf76f60c1ccd8a..af37b44928c2ef67980adecf7e1bd3e2dd3bba22 100644 (file)
@@ -243,6 +243,7 @@ void free_proxy(struct proxy *p)
                        free(rdr->cond);
                }
                free(rdr->rdr_str);
+               free(rdr->cookie_str);
                list_for_each_entry_safe(lf, lfb, &rdr->rdr_fmt, list) {
                        LIST_DELETE(&lf->list);
                        release_sample_expr(lf->expr);