mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-06 23:27:04 +02:00
BUG/MINOR: cfgparse-tcp: 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
beca953c55
commit
bbd1cedefc
@ -144,6 +144,10 @@ static int bind_parse_interface(char **args, int cur_arg, struct proxy *px, stru
|
||||
|
||||
ha_free(&conf->settings.interface);
|
||||
conf->settings.interface = strdup(args[cur_arg + 1]);
|
||||
if (!conf->settings.interface) {
|
||||
memprintf(err, "'%s %s' : out of memory", args[cur_arg], args[cur_arg + 1]);
|
||||
return ERR_ALERT | ERR_FATAL;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user