MINOR: server: return the next srv instance on free_server
As a convenience, return the next server instance from servers list on
free_server.
This is particularily useful when using this function on the servers
list without having to save of the next pointer before calling it.
(cherry picked from commit f5c1e12e44e1caa0185e063daf00fb8841c2ed3d)
[ad: updated context: remove uneeded condition on srv]
Signed-off-by: Amaury Denoyelle <adenoyelle@haproxy.com>
diff --git a/src/proxy.c b/src/proxy.c
index 0e96571..54aaa8d 100644
--- a/src/proxy.c
+++ b/src/proxy.c
@@ -131,7 +131,7 @@
void free_proxy(struct proxy *p)
{
- struct server *s,*s_next;
+ struct server *s;
struct cap_hdr *h,*h_next;
struct listener *l,*l_next;
struct bind_conf *bind_conf, *bind_back;
@@ -286,11 +286,9 @@
s = p->srv;
while (s) {
- s_next = s->next;
list_for_each_entry(srvdf, &server_deinit_list, list)
srvdf->fct(s);
- free_server(s);
- s = s_next;
+ s = free_server(s);
}/* end while(s) */
list_for_each_entry_safe(l, l_next, &p->conf.listeners, by_fe) {