mirror of
https://github.com/haproxy/haproxy.git
synced 2026-04-20 22:01:49 -04:00
BUG/MINOR: listener: 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:
parent
495f1f9741
commit
89c62693da
1 changed files with 6 additions and 1 deletions
|
|
@ -2369,8 +2369,13 @@ static int bind_parse_name(char **args, int cur_arg, struct proxy *px, struct bi
|
|||
return ERR_ALERT | ERR_FATAL;
|
||||
}
|
||||
|
||||
list_for_each_entry(l, &conf->listeners, by_bind)
|
||||
list_for_each_entry(l, &conf->listeners, by_bind) {
|
||||
l->name = strdup(args[cur_arg + 1]);
|
||||
if (!l->name) {
|
||||
memprintf(err, "'%s %s' : out of memory", args[cur_arg], args[cur_arg + 1]);
|
||||
return ERR_ALERT | ERR_FATAL;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue