coverity 1456642: fix null check
authorPauli <paul.dale@oracle.com>
Fri, 3 Jan 2020 09:19:47 +0000 (19:19 +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_rsa_priv.c

index 05d9316ba1870c840ebb407f9b0227dca9891416..3d16e43a4b194d50eb8cf622f73d03b526aec726 100644 (file)
@@ -77,11 +77,9 @@ static void *rsa_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;
 }