mirror of
https://github.com/haproxy/haproxy.git
synced 2026-03-22 18:33:28 -04:00
BUG/MINOR: debug: 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
a3e6c783cd
commit
6524fbfb70
1 changed files with 2 additions and 0 deletions
|
|
@ -2048,6 +2048,8 @@ static int debug_parse_cli_memstats(char **args, char *payload, struct appctx *a
|
|||
else if (strcmp(args[arg], "match") == 0 && *args[arg + 1]) {
|
||||
ha_free(&ctx->match);
|
||||
ctx->match = strdup(args[arg + 1]);
|
||||
if (!ctx->match)
|
||||
return cli_err(appctx, "Out of memory.\n");
|
||||
arg++;
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue