coverity 1456638: fix null check
authorPauli <paul.dale@oracle.com>
Fri, 3 Jan 2020 09:28:37 +0000 (19:28 +1000)
committerPauli <paul.dale@oracle.com>
Sun, 5 Jan 2020 08:05:14 +0000 (18:05 +1000)
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/10748)

providers/implementations/serializers/serializer_dsa_priv.c

index 603904369a2e459b813b05ed4537edf1937f273b..fc0a340ca27d019cb167f8fe4642e7f19a54ee7e 100644 (file)
@@ -48,11 +48,10 @@ static void *dsa_priv_newctx(void *provctx)
 
     if (ctx != NULL) {
         ctx->provctx = provctx;
-    }
-
-    /* -1 is the "whatever" indicator, i.e. the PKCS8 library default PBE */
-    ctx->sc.pbe_nid = -1;
 
+        /* -1 is the "whatever" indicator, i.e. the PKCS8 library default PBE */
+        ctx->sc.pbe_nid = -1;
+    }
     return ctx;
 }