]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
If an error occurs constructing the quic record layer, free it properly
authorMatt Caswell <matt@openssl.org>
Fri, 13 Oct 2023 15:33:31 +0000 (16:33 +0100)
committerMatt Caswell <matt@openssl.org>
Mon, 23 Oct 2023 09:08:22 +0000 (10:08 +0100)
We need to call quic_free() to free the record layer to ensure than any
BIO that was already set is also freed.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22368)

ssl/quic/quic_tls.c

index a1bcedbfb071642a7a9cf2050f09b7cc2c8b03fa..af4af56c77b4adfb59c9445ed95199979c59cc38 100644 (file)
@@ -85,6 +85,7 @@ struct ossl_record_layer_st {
 };
 
 static int quic_set1_bio(OSSL_RECORD_LAYER *rl, BIO *bio);
+static int quic_free(OSSL_RECORD_LAYER *r);
 
 static int
 quic_new_record_layer(OSSL_LIB_CTX *libctx, const char *propq, int vers,
@@ -189,7 +190,7 @@ quic_new_record_layer(OSSL_LIB_CTX *libctx, const char *propq, int vers,
     return 1;
  err:
     *retrl = NULL;
-    OPENSSL_free(rl);
+    quic_free(rl);
     return 0;
 }