mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-21 13:51:26 +02:00
BUG/MINOR: server: check return value of fopen() in apply_server_state()
fopen() can return NULL when state file is missing. This patch adds a check of fopen() return value so we can skip processing in such case. No backport needed.
This commit is contained in:
parent
4381d26edc
commit
5d48627aba
@ -3595,6 +3595,8 @@ void apply_server_state(void)
|
|||||||
f = fopen(globalfilepath, "r");
|
f = fopen(globalfilepath, "r");
|
||||||
if (errno)
|
if (errno)
|
||||||
ha_warning("Can't open global server state file '%s': %s\n", globalfilepath, strerror(errno));
|
ha_warning("Can't open global server state file '%s': %s\n", globalfilepath, strerror(errno));
|
||||||
|
if (!f)
|
||||||
|
goto out_load_server_state_in_tree;
|
||||||
|
|
||||||
global_file_version = srv_state_get_version(f);
|
global_file_version = srv_state_get_version(f);
|
||||||
if (global_file_version == 0)
|
if (global_file_version == 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user