mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-07 15:47:01 +02:00
BUG/MINOR: check_config_validity: check the returned value of stktable_init()
The function stktable_init() will return 0 if create_pool() returns NULL. Since the returned value of this function is ignored, HAProxy will crash if the pool of stick table is NULL and stksess_new() is called to allocate a new stick session. It is a better choice to check the returned value and make HAProxy exit with alert message if any error is caught. Signed-off-by: Godbach <nylzhaowei@gmail.com>
This commit is contained in:
parent
7056a35217
commit
9703e66bce
@ -7535,8 +7535,12 @@ int check_config_validity()
|
||||
* be done earlier because the data size may be discovered while parsing
|
||||
* other proxies.
|
||||
*/
|
||||
for (curproxy = proxy; curproxy; curproxy = curproxy->next)
|
||||
stktable_init(&curproxy->table);
|
||||
for (curproxy = proxy; curproxy; curproxy = curproxy->next) {
|
||||
if (!stktable_init(&curproxy->table)) {
|
||||
Alert("Proxy '%s': failed to initialize stick-table.\n", curproxy->id);
|
||||
cfgerr++;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Recount currently required checks.
|
||||
|
Loading…
Reference in New Issue
Block a user