mirror of
https://github.com/haproxy/haproxy.git
synced 2026-06-15 20:39:44 -04:00
[BUG] appsession: possible memory leak in case of out of memory condition
I've tried to follow all the pool_alloc2/pool_free2 calls in the code to track memory leaks. I've found one which only happens when there's already no more memory when allocating a new appsession cookie.
This commit is contained in:
parent
81e3b4f48d
commit
41689c22da
1 changed files with 2 additions and 0 deletions
|
|
@ -5957,6 +5957,7 @@ void manage_server_side_cookies(struct session *t, struct buffer *rtr)
|
|||
if ((asession->sessid = pool_alloc2(apools.sessid)) == NULL) {
|
||||
Alert("Not enough Memory process_srv():asession->sessid:malloc().\n");
|
||||
send_log(t->be, LOG_ALERT, "Not enough Memory process_srv():asession->sessid:malloc().\n");
|
||||
t->be->htbl_proxy.destroy(asession);
|
||||
return;
|
||||
}
|
||||
memcpy(asession->sessid, t->sessid, t->be->appsession_len);
|
||||
|
|
@ -5966,6 +5967,7 @@ void manage_server_side_cookies(struct session *t, struct buffer *rtr)
|
|||
if ((asession->serverid = pool_alloc2(apools.serverid)) == NULL) {
|
||||
Alert("Not enough Memory process_srv():asession->sessid:malloc().\n");
|
||||
send_log(t->be, LOG_ALERT, "Not enough Memory process_srv():asession->sessid:malloc().\n");
|
||||
t->be->htbl_proxy.destroy(asession);
|
||||
return;
|
||||
}
|
||||
asession->serverid[0] = '\0';
|
||||
|
|
|
|||
Loading…
Reference in a new issue