projects
/
haproxy-2.1.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4c3508c
)
BUG/MINOR: cfgparse: Fail if the strdup() for `rule->be.name` for `use_backend` fails
author
Tim Duesterhus
<tim@bastelstu.be>
Sun, 3 Jan 2021 21:54:43 +0000
(22:54 +0100)
committer
Christopher Faulet
<cfaulet@haproxy.com>
Fri, 8 Jan 2021 10:44:26 +0000
(11:44 +0100)
This patch fixes GitHub issue #1024.
I could track the `strdup` back to commit
3a1f5fda109fc56ae127d03eaf34ce027c9542e1
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+.
(cherry picked from commit
5ce5a1586d8c67affa604dedf0faa2c5a02ecab5
)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit
f46d9cd735d1664c113c041d85179a81bded8fc6
)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit
fdca7df8181de29a661be4e8f91160b087843167
)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
src/cfgparse-listen.c
patch
|
blob
|
history
diff --git
a/src/cfgparse-listen.c
b/src/cfgparse-listen.c
index
62d1388
..
54243f6
100644
(file)
--- a/
src/cfgparse-listen.c
+++ b/
src/cfgparse-listen.c
@@
-1539,6
+1539,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) {