SSL: fixed memory leak in ngx_ssl_get_ech_outer_server_name().

SSL_ech_get1_status() allocates inner_sni and outer_sni and transfers
ownership to the caller.  On the allocation-failure path the function
returned without freeing them, unlike ngx_ssl_get_ech_status() which
frees both on all paths.
This commit is contained in:
David Carlier 2026-06-16 19:58:28 +01:00
parent da80db978f
commit 3269ede954
No known key found for this signature in database
GPG key ID: 1E190B4E2E828ED7

View file

@ -5953,6 +5953,8 @@ ngx_ssl_get_ech_outer_server_name(ngx_connection_t *c, ngx_pool_t *pool,
s->data = ngx_pnalloc(pool, s->len);
if (s->data == NULL) {
OPENSSL_free(inner_sni);
OPENSSL_free(outer_sni);
return NGX_ERROR;
}