BUG/MINOR: server: fix a possible leak of an error message in dynamic servers

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.
This commit is contained in:
Willy Tarreau 2026-04-23 15:10:01 +02:00
parent 72b5bf7285
commit 5a59b158ff

View 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;
}
}