mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2024-12-14 07:24:32 +00:00
BUG/MINOR: server: fix potential null gcc error in delete server
gcc still reports a potential null pointer dereference in delete server function event with a BUG_ON before it. Remove the misleading NULL check in the for loop which should never happen. This does not need to be backported.
This commit is contained in:
parent
b77cd7f562
commit
d6b4b6da3f
10
src/server.c
10
src/server.c
@ -4563,12 +4563,12 @@ static int cli_parse_delete_server(char **args, char *payload, struct appctx *ap
|
||||
}
|
||||
else {
|
||||
struct server *next;
|
||||
for (next = be->srv; next && srv != next->next; next = next->next)
|
||||
;
|
||||
for (next = be->srv; srv != next->next; next = next->next) {
|
||||
/* srv cannot be not found since we have already found
|
||||
* it with get_backend_server */
|
||||
BUG_ON(!next);
|
||||
}
|
||||
|
||||
/* srv cannot be not found since we have already found it
|
||||
* with get_backend_server */
|
||||
BUG_ON(!next);
|
||||
next->next = srv->next;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user