quic: fix coverity warning 27/24827/2
authorMathiasRaoul <mathias.raoul@gmail.com>
Thu, 6 Feb 2020 10:31:03 +0000 (10:31 +0000)
committerDave Barach <openvpp@barachs.net>
Thu, 6 Feb 2020 14:43:25 +0000 (14:43 +0000)
Type: fix
Change-Id: I7299b3b0a6d32c1cbe213dc1aadb8260cdec8062
Signed-off-by: MathiasRaoul <mathias.raoul@gmail.com>
src/plugins/quic/quic_crypto.c

index b644bed..7d51303 100644 (file)
@@ -209,12 +209,12 @@ quic_crypto_setup_cipher (quicly_crypto_engine_t * engine,
 Exit:
   if (ret != 0)
     {
-      if (*aead_ctx != NULL)
+      if (aead_ctx && *aead_ctx != NULL)
        {
          ptls_aead_free (*aead_ctx);
          *aead_ctx = NULL;
        }
-      if (*hp_ctx != NULL)
+      if (hp_ctx && *hp_ctx != NULL)
        {
          ptls_cipher_free (*hp_ctx);
          *hp_ctx = NULL;