mirror of
http://git.haproxy.org/git/haproxy.git
synced 2026-02-18 12:46:45 +02:00
BUG/MINOR: cfgparse: Fail if the strdup() for rule->be.name for use_backend fails
This patch fixes GitHub issue #1024.
I could track the `strdup` back to commit
3a1f5fda10 which is 1.9-dev8. It's probably not
worth the effort to backport it across this refactoring.
This patch should be backported to 1.9+.
This commit is contained in:
committed by
Willy Tarreau
parent
782e9be1b3
commit
5ce5a1586d
@@ -1510,6 +1510,10 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm)
|
||||
}
|
||||
rule->cond = cond;
|
||||
rule->be.name = strdup(args[1]);
|
||||
if (!rule->be.name) {
|
||||
ha_alert("Out of memory error.\n");
|
||||
goto out;
|
||||
}
|
||||
rule->line = linenum;
|
||||
rule->file = strdup(file);
|
||||
if (!rule->file) {
|
||||
|
||||
Reference in New Issue
Block a user