mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2024-12-17 00:44:33 +00:00
BUG/MINOR: stick-table: handle out-of-memory condition gracefully
In case `pool_alloc2()` returns NULL, propagate the condition to the caller. This could happen when limiting the amount of memory available for HAProxy with `-m`. [wt: backport to 1.6 and 1.5 needed]
This commit is contained in:
parent
a71f642b62
commit
ef8f4fe12d
@ -170,9 +170,10 @@ struct stksess *stksess_new(struct stktable *t, struct stktable_key *key)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ts = pool_alloc2(t->pool) + t->data_size;
|
||||
ts = pool_alloc2(t->pool);
|
||||
if (ts) {
|
||||
t->current++;
|
||||
ts += t->data_size;
|
||||
stksess_init(t, ts);
|
||||
if (key)
|
||||
stksess_setkey(t, ts, key);
|
||||
|
Loading…
Reference in New Issue
Block a user