From: Matt Caswell Date: Fri, 13 Oct 2023 15:33:31 +0000 (+0100) Subject: If an error occurs constructing the quic record layer, free it properly X-Git-Tag: openssl-3.2.0-beta1~41 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d8a4451fa76c83ba08b42b38848ba9705fbe71a2;p=thirdparty%2Fopenssl.git If an error occurs constructing the quic record layer, free it properly 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 Reviewed-by: Hugo Landau (Merged from https://github.com/openssl/openssl/pull/22368) --- diff --git a/ssl/quic/quic_tls.c b/ssl/quic/quic_tls.c index a1bcedbfb07..af4af56c77b 100644 --- a/ssl/quic/quic_tls.c +++ b/ssl/quic/quic_tls.c @@ -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; }