This defect was found by the coccinelle script "unchecked-strdup.cocci".
It can be backported to all supported branches.
---
src/debug.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/debug.c b/src/debug.c
index d052f5b63..2c5e35553 100644
--- a/src/debug.c
+++ b/src/debug.c
@@ -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 1;
arg++;
continue;
}
--
2.46.0.windows.1