BUG/MINOR: proxy: fix source interface and usesrc leaks on deinit()
proxy conn_src.iface_name was only freed in proxy_free_defaults(), whereas
proxy conn_src.bind_hdr_name was only freed in free_proxy().
Because of that, using "source usesrc hdr_ip()" in a default proxy, or
"source interface" in a regular or default proxy would cause memory leaks
during deinit.
It may be backported to all stable versions.
(cherry picked from commit 1aa219078dbaeef402b43af24538078fdd875790)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit e724bd3cd892ccb75c2dbf4453e680c17155ce52)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 7f46380380553cda0622e47455789d10cb2515f1)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
diff --git a/src/proxy.c b/src/proxy.c
index 305c10c..768d963 100644
--- a/src/proxy.c
+++ b/src/proxy.c
@@ -178,6 +178,7 @@
free(p->rdp_cookie_name);
free(p->invalid_rep);
free(p->invalid_req);
+ ha_free(&p->conn_src.iface_name);
#if defined(CONFIG_HAP_TRANSPARENT)
free(p->conn_src.bind_hdr_name);
#endif
@@ -1494,6 +1495,9 @@
istfree(&defproxy->monitor_uri);
ha_free(&defproxy->defbe.name);
ha_free(&defproxy->conn_src.iface_name);
+#if defined(CONFIG_HAP_TRANSPARENT)
+ ha_free(&defproxy->conn_src.bind_hdr_name);
+#endif
istfree(&defproxy->server_id_hdr_name);
http_ext_clean(defproxy);