mirror of
https://github.com/haproxy/haproxy.git
synced 2026-04-20 22:01:49 -04: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
1 changed files with 2 additions and 0 deletions
|
|
@ -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 a new issue