]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: server: fix a possible leak of an error message in dynamic servers
authorWilly Tarreau <w@1wt.eu>
Thu, 23 Apr 2026 13:10:01 +0000 (15:10 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 23 Apr 2026 13:10:01 +0000 (15:10 +0200)
In 3.4-dev6, commit de5fc2f515 ("BUG/MINOR: server: set auto SNI for
dynamic servers") allowed to properly set the SNI, and return an error
message. However the error message is leaked after being printed on the
CLI.

This should be backported to 3.3.

src/server.c

index bf8241b792328f68f4e7ef929fa2fe20167d1869..88a05288ec9239dfee956f9ec570ff3584283b1f 100644 (file)
@@ -6296,6 +6296,7 @@ static int cli_parse_add_server(char **args, char *payload, struct appctx *appct
            !srv->sni_expr && !(srv->ssl_ctx.options & SRV_SSL_O_NO_AUTO_SNI)) {
                if (srv_configure_auto_sni(srv, &errcode, &errmsg)) {
                        ha_alert("%s.\n", errmsg);
+                       ha_free(&errmsg);
                        goto out;
                }
        }