Skip to content

Commit

Permalink
If an error occurs constructing the quic record layer, free it properly
Browse files Browse the repository at this point in the history
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 #22368)
  • Loading branch information
mattcaswell committed Oct 23, 2023
1 parent d8bf5ea commit d8a4451
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ssl/quic/quic_tls.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit d8a4451

Please sign in to comment.