BUG/MINOR: mux_h1: handle a possible strdup() failure

This defect was found by the coccinelle script "unchecked-strdup.cocci".
It can be backported to all supported branches.
This commit is contained in:
Ilia Shipitsin 2024-12-23 22:00:48 +01:00 committed by Willy Tarreau
parent 89c62693da
commit a3e6c783cd

View File

@ -5663,7 +5663,11 @@ 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) {
memprintf(err, "'%s %s' : out of memory", args[0], args[1]);
return -1;
}
return 0;
}
/* config parser for global "tune.h1.zero-copy-fwd-recv" */