coverity 1462573 Dereference after null check
[openssl.git] / crypto / evp / pmeth_gn.c
index dbc6c914e76497e7c8a0d2616cf0298e8dbeac39..dc1dad86ba9044af5506ea92f097da8500880ee3 100644 (file)
@@ -93,7 +93,7 @@ static int gen_init(EVP_PKEY_CTX *ctx, int operation)
 #endif
 
  end:
-    if (ret <= 0)
+    if (ret <= 0 && ctx != NULL)
         ctx->operation = EVP_PKEY_OP_UNDEFINED;
     return ret;