]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fix coverity 1516094 uninit
authorTodd Short <tshort@akamai.com>
Wed, 19 Oct 2022 14:13:35 +0000 (10:13 -0400)
committerPauli <pauli@openssl.org>
Thu, 20 Oct 2022 23:33:40 +0000 (10:33 +1100)
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19440)

ssl/statem/statem_clnt.c

index ac4fb4e00dfa759ce2ea3e21cb1a5bfef3a67d87..3021bc195250fb95aff6254db16f948fcf298bec 100644 (file)
@@ -3732,7 +3732,10 @@ CON_FUNC_RETURN tls_construct_client_compressed_certificate(SSL_CONNECTION *sc,
  err:
     SSLfatal(sc, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  out:
-    WPACKET_cleanup(&tmppkt);
+    if (buf != NULL) {
+        /* If |buf| is NULL, then |tmppkt| could not have been initialized */
+        WPACKET_cleanup(&tmppkt);
+    }
     BUF_MEM_free(buf);
     COMP_CTX_free(comp);
     return ret;