]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic: free SSL context on quic_conn free
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 20 Jan 2022 16:43:20 +0000 (17:43 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 21 Jan 2022 14:20:07 +0000 (15:20 +0100)
Free the SSL context attached to the quic_conn when freeing the
connection. This fixes a memory leak for every QUIC connection.

src/xprt_quic.c

index 21cff9cf71dd898a5245bdc8c68d7894359c0bac..13fc2a15f9a40c86bcb7b53418f125fa6c330381 100644 (file)
@@ -3389,8 +3389,10 @@ static void quic_conn_drop(struct quic_conn *qc)
                return;
 
        conn_ctx = HA_ATOMIC_LOAD(&qc->xprt_ctx);
-       if (conn_ctx)
+       if (conn_ctx) {
+               SSL_free(conn_ctx->ssl);
                pool_free(pool_head_quic_conn_ctx, conn_ctx);
+       }
 
        for (i = 0; i < QUIC_TLS_ENC_LEVEL_MAX; i++)
                quic_conn_enc_level_uninit(&qc->els[i]);