]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic: Remove pool_zalloc() from qc_conn_alloc_ssl_ctx()
authorFrédéric Lécaille <flecaille@haproxy.com>
Thu, 15 Jun 2023 09:02:53 +0000 (11:02 +0200)
committerFrédéric Lécaille <flecaille@haproxy.com>
Fri, 16 Jun 2023 14:56:08 +0000 (16:56 +0200)
pool_zalloc() is replaced by pool_alloc() into qc_conn_alloc_ssl_ctx() to allocate
a ssl_sock_ctx struct. ssl_sock_ctx struct member are all initiliazed to null values
excepted ->ssl which is initialized by the next statement: a call to qc_ssl_sess_init().

src/quic_conn.c

index 93773995f0aca073271678fa1b828ffa86cff5b9..9140901d333b8b7bbed663bd63aa857226dcff25 100644 (file)
@@ -6806,14 +6806,22 @@ static int qc_conn_alloc_ssl_ctx(struct quic_conn *qc)
 
        TRACE_ENTER(QUIC_EV_CONN_NEW, qc);
 
-       ctx = pool_zalloc(pool_head_quic_conn_ctx);
+       ctx = pool_alloc(pool_head_quic_conn_ctx);
        if (!ctx) {
                TRACE_ERROR("SSL context allocation failed", QUIC_EV_CONN_TXPKT);
                goto err;
        }
 
-       ctx->subs = NULL;
+       ctx->conn = NULL;
+       ctx->bio = NULL;
+       ctx->xprt = NULL;
        ctx->xprt_ctx = NULL;
+       memset(&ctx->wait_event, 0, sizeof(ctx->wait_event));
+       ctx->subs = NULL;
+       ctx->xprt_st = 0;
+       ctx->error_code = 0;
+       ctx->early_buf = BUF_NULL;
+       ctx->sent_early_data = 0;
        ctx->qc = qc;
 
        if (qc_is_listener(qc)) {