ossl_quic_new(): Avoid dereferencing NULL qc during cleanup
authorTomas Mraz <tomas@openssl.org>
Fri, 3 Nov 2023 07:52:43 +0000 (08:52 +0100)
committerHugo Landau <hlandau@openssl.org>
Mon, 6 Nov 2023 07:50:08 +0000 (07:50 +0000)
Fixes Coverity 1548383

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22606)

ssl/quic/quic_impl.c

index dd689865e40f53317a18765c9e9ddcaa4c491335..399d1d2afd15e468b8c6044db6e056aca7be3d58 100644 (file)
@@ -382,7 +382,7 @@ SSL *ossl_quic_new(SSL_CTX *ctx)
     qc = OPENSSL_zalloc(sizeof(*qc));
     if (qc == NULL) {
         QUIC_RAISE_NON_NORMAL_ERROR(NULL, ERR_R_CRYPTO_LIB, NULL);
-        goto err;
+        return NULL;
     }
 #if defined(OPENSSL_THREADS)
     if ((qc->mutex = ossl_crypto_mutex_new()) == NULL) {