mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-05-04 20:46:11 +02:00
MINOR: cli: use srv_drop() when server was created using new_server()
Now that new_server() is becoming more and more complex, we need to take care that servers created using new_server() must be released using the corresponding release function srv_drop() which takes care of properly de-initing the server and its members.
This commit is contained in:
parent
eebb448f49
commit
12dc9325a7
@ -3737,11 +3737,8 @@ int mworker_cli_attach_server(char **errmsg)
|
||||
|
||||
error:
|
||||
|
||||
list_for_each_entry(child, &proc_list, list) {
|
||||
free((char *)child->srv->conf.file); /* cast because of const char * */
|
||||
free(child->srv->id);
|
||||
srv_free(&child->srv);
|
||||
}
|
||||
list_for_each_entry(child, &proc_list, list)
|
||||
srv_drop(child->srv);
|
||||
free(msg);
|
||||
|
||||
return -1;
|
||||
|
||||
@ -3434,7 +3434,7 @@ static int _srv_parse_tmpl_init(struct server *srv, struct proxy *px)
|
||||
free_check(&newsrv->check);
|
||||
MT_LIST_DELETE(&newsrv->global_list);
|
||||
}
|
||||
srv_free(&newsrv);
|
||||
srv_drop(newsrv);
|
||||
return i - srv->tmpl_info.nb_low;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user