]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: spoe: Fix memory leak if failing to allocate memory
authorTim Duesterhus <tim@bastelstu.be>
Sun, 23 Jun 2019 20:10:13 +0000 (22:10 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 24 Jun 2019 12:38:15 +0000 (14:38 +0200)
Technically harmless, but it annoys clang analyzer.

This bug was introduced in 336d3ef0e77192582c98b3c578927a529ceadd9b.
This fix should be backported to HAProxy 1.9+.

src/flt_spoe.c

index f20b2640baf41fdce61734e24f98e5a748c7a721..4e48aa95c6cc27b9715c3e6226205e0b086f55f7 100644 (file)
@@ -3751,6 +3751,7 @@ cfg_parse_spoe_agent(const char *file, int linenum, char **args, int kwm)
                                goto out;
                        }
                        if ((vph->name  = strdup(args[cur_arg])) == NULL) {
+                               free(vph);
                                ha_alert("parsing [%s:%d] : out of memory.\n", file, linenum);
                                err_code |= ERR_ALERT | ERR_ABORT;
                                goto out;