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 f4a4af100..d653ac3c9 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.46.0.windows.1