This defect was found by the coccinelle script "unchecked-strdup.cocci".
It can be backported to all supported branches.
---
src/mux_h1.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/mux_h1.c b/src/mux_h1.c
index 7eb18133d..0206dcbd0 100644
--- a/src/mux_h1.c
+++ b/src/mux_h1.c
@@ -5663,7 +5663,10 @@ static int cfg_parse_h1_headers_case_adjust_file(char
**args, int section_type,
}
free(hdrs_map.name);
hdrs_map.name = strdup(args[1]);
- return 0;
+ if (!hdrs_map.name)
+ return -1;
+
+ return 0;
}
/* config parser for global "tune.h1.zero-copy-fwd-recv" */
--
2.46.0.windows.1