Skip to content

Commit

Permalink
BUG/MINOR: debug: handle a possible strdup() failure
Browse files Browse the repository at this point in the history
This defect was found by the coccinelle script "unchecked-strdup.cocci".
It can be backported to all supported branches.
  • Loading branch information
chipitsine authored and wtarreau committed Dec 25, 2024
1 parent a3e6c78 commit 6524fbf
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 6524fbf

Please sign in to comment.