From: Amaury Denoyelle Date: Tue, 26 Jan 2021 13:35:22 +0000 (+0100) Subject: BUG/MINOR: config: fix leak on proxy.conn_src.bind_hdr_name X-Git-Tag: v2.4-dev7~140 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=69c5c3ab330584f9c53e2cf7c86af371a84f104d;p=thirdparty%2Fhaproxy.git BUG/MINOR: config: fix leak on proxy.conn_src.bind_hdr_name Leak for parsing of option usesrc of the source keyword. This can be backported to 1.8. --- diff --git a/src/cfgparse-listen.c b/src/cfgparse-listen.c index 588ff9704a..689a28eb3d 100644 --- a/src/cfgparse-listen.c +++ b/src/cfgparse-listen.c @@ -2915,6 +2915,7 @@ stats_error_parsing: curproxy->conn_src.opts &= ~CO_SRC_TPROXY_MASK; curproxy->conn_src.opts |= CO_SRC_TPROXY_DYN; + free(curproxy->conn_src.bind_hdr_name); curproxy->conn_src.bind_hdr_name = calloc(1, end - name + 1); curproxy->conn_src.bind_hdr_len = end - name; memcpy(curproxy->conn_src.bind_hdr_name, name, end - name); diff --git a/src/haproxy.c b/src/haproxy.c index e36e020c5c..cdbc3dc96b 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -2503,6 +2503,9 @@ void deinit(void) free(p->rdp_cookie_name); free(p->invalid_rep); free(p->invalid_req); +#if defined(CONFIG_HAP_TRANSPARENT) + free(p->conn_src.bind_hdr_name); +#endif if (p->conf.logformat_string != default_http_log_format && p->conf.logformat_string != default_tcp_log_format && p->conf.logformat_string != clf_http_log_format)