From beca953c559f4f49c7cf1df0239ae7d747213248 Mon Sep 17 00:00:00 2001 From: Ilia Shipitsin Date: Fri, 27 Dec 2024 21:55:07 +0100 Subject: [PATCH] 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. --- src/pool.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pool.c b/src/pool.c index f4a4af1005..d653ac3c91 100644 --- a/src/pool.c +++ b/src/pool.c @@ -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])) { -- 2.47.3