mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-10 09:07:02 +02:00
BUG/MEDIUM: server: resolve state file handle leak on reload
During reload, server state file is read and file handle is not released this was indepently reported in #738 and #660. partially resolves #660. This should be backported to 2.2 and 2.1.
This commit is contained in:
parent
b605a736b0
commit
dc6e8a9a7b
11
src/server.c
11
src/server.c
@ -3268,6 +3268,11 @@ void apply_server_state(void)
|
|||||||
}
|
}
|
||||||
out_load_server_state_in_tree:
|
out_load_server_state_in_tree:
|
||||||
|
|
||||||
|
if (f) {
|
||||||
|
fclose(f);
|
||||||
|
f = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/* parse all proxies and load states form tree (global file) or from local file */
|
/* parse all proxies and load states form tree (global file) or from local file */
|
||||||
for (curproxy = proxies_list; curproxy != NULL; curproxy = curproxy->next) {
|
for (curproxy = proxies_list; curproxy != NULL; curproxy = curproxy->next) {
|
||||||
/* servers are only in backends */
|
/* servers are only in backends */
|
||||||
@ -3447,9 +3452,11 @@ void apply_server_state(void)
|
|||||||
/* now we can proceed with server's state update */
|
/* now we can proceed with server's state update */
|
||||||
srv_update_state(srv, version, srv_params);
|
srv_update_state(srv, version, srv_params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fileclose:
|
||||||
|
fclose(f);
|
||||||
|
|
||||||
}
|
}
|
||||||
fileclose:
|
|
||||||
fclose(f);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* now free memory allocated for the tree */
|
/* now free memory allocated for the tree */
|
||||||
|
Loading…
Reference in New Issue
Block a user