mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-05-04 12:41:00 +02:00
[BUG] stick_table: fix possible memory leak in case of connection error
If a "stick store-request" rule is present, an entry is preallocated during the request. However, if there is no response due to an error or to a redir mode server, we never release it.
This commit is contained in:
parent
5ce9457d99
commit
a4cda67323
@ -50,6 +50,7 @@ void session_free(struct session *s)
|
||||
struct http_txn *txn = &s->txn;
|
||||
struct proxy *fe = s->fe;
|
||||
struct bref *bref, *back;
|
||||
int i;
|
||||
|
||||
if (s->pend_pos)
|
||||
pendconn_free(s->pend_pos);
|
||||
@ -82,6 +83,13 @@ void session_free(struct session *s)
|
||||
|
||||
http_end_txn(s);
|
||||
|
||||
for (i = 0; i < s->store_count; i++) {
|
||||
if (!s->store[i].ts)
|
||||
continue;
|
||||
stksess_free(s->store[i].table, s->store[i].ts);
|
||||
s->store[i].ts = NULL;
|
||||
}
|
||||
|
||||
if (fe) {
|
||||
pool_free2(fe->hdr_idx_pool, txn->hdr_idx.v);
|
||||
pool_free2(fe->rsp_cap_pool, txn->rsp.cap);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user