mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-07 07:37:02 +02:00
BUG/MINOR: pool: handle a possible strdup() failure
This defect was found by the coccinelle script "unchecked-strdup.cocci". It can be backported to all supported branches.
This commit is contained in:
parent
b4f965be9e
commit
beca953c55
@ -1373,6 +1373,8 @@ static int cli_parse_show_pools(char **args, char *payload, struct appctx *appct
|
||||
}
|
||||
else if (strcmp(args[arg], "match") == 0 && *args[arg+1]) {
|
||||
ctx->prefix = strdup(args[arg+1]); // only pools starting with this
|
||||
if (!ctx->prefix)
|
||||
return cli_err(appctx, "Out of memory.\n");
|
||||
arg++;
|
||||
}
|
||||
else if (isdigit((unsigned char)*args[arg])) {
|
||||
|
Loading…
Reference in New Issue
Block a user