Skip to content

Commit e724bd3

Browse files
Darleletcapflam
authored andcommitted
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 1aa2190) Signed-off-by: Christopher Faulet <[email protected]>
1 parent 6b16cfe commit e724bd3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/proxy.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ void free_proxy(struct proxy *p)
226226
free_email_alert(p);
227227
free(p->invalid_rep);
228228
free(p->invalid_req);
229+
ha_free(&p->conn_src.iface_name);
229230
#if defined(CONFIG_HAP_TRANSPARENT)
230231
free(p->conn_src.bind_hdr_name);
231232
#endif
@@ -1454,6 +1455,9 @@ void proxy_free_defaults(struct proxy *defproxy)
14541455
istfree(&defproxy->monitor_uri);
14551456
ha_free(&defproxy->defbe.name);
14561457
ha_free(&defproxy->conn_src.iface_name);
1458+
#if defined(CONFIG_HAP_TRANSPARENT)
1459+
ha_free(&defproxy->conn_src.bind_hdr_name);
1460+
#endif
14571461
istfree(&defproxy->server_id_hdr_name);
14581462

14591463
http_ext_clean(defproxy);

0 commit comments

Comments
 (0)