[BUG/CLEANUP] cookiedomain -> cookie_domain rename + free(p->cookie_domain)
Rename cookiedomain -> cookie_domain to be consistent with current
naming scheme. Also make sure cookie_domain is deallocated at deinit()
diff --git a/src/cfgparse.c b/src/cfgparse.c
index 9ca8ae6..e4308bf 100644
--- a/src/cfgparse.c
+++ b/src/cfgparse.c
@@ -917,7 +917,7 @@
return -1;
}
- curproxy->cookiedomain = strdup(args[cur_arg + 1]);
+ curproxy->cookie_domain = strdup(args[cur_arg + 1]);
cur_arg++;
}
else {
diff --git a/src/haproxy.c b/src/haproxy.c
index fc82d2f..b42728e 100644
--- a/src/haproxy.c
+++ b/src/haproxy.c
@@ -658,6 +658,9 @@
if (p->cookie_name)
free(p->cookie_name);
+ if (p->cookie_domain)
+ free(p->cookie_domain);
+
if (p->url_param_name)
free(p->url_param_name);
diff --git a/src/proto_http.c b/src/proto_http.c
index 3caeba1..066db30 100644
--- a/src/proto_http.c
+++ b/src/proto_http.c
@@ -3222,8 +3222,8 @@
t->be->cookie_name,
t->srv->cookie ? t->srv->cookie : "; Expires=Thu, 01-Jan-1970 00:00:01 GMT");
- if (t->be->cookiedomain)
- len += sprintf(trash+len, "; domain=%s", t->be->cookiedomain);
+ if (t->be->cookie_domain)
+ len += sprintf(trash+len, "; domain=%s", t->be->cookie_domain);
if (unlikely(http_header_add_tail2(rep, &txn->rsp, &txn->hdr_idx,
trash, len)) < 0)