PR: 2908
[oweals/openssl.git] / apps / genrsa.c
index 09b0b1969001e6d64f67bf88562844b19c0d0c87..dfb01399e0ef5ce2ac215e6ad46f0988b73caf5a 100644 (file)
@@ -89,9 +89,6 @@ int MAIN(int, char **);
 int MAIN(int argc, char **argv)
        {
        BN_GENCB cb;
-#ifndef OPENSSL_NO_ENGINE
-       ENGINE *e = NULL;
-#endif
        int ret=1;
        int i,num=DEFBITS;
        long l;
@@ -235,7 +232,7 @@ bad:
        }
 
 #ifndef OPENSSL_NO_ENGINE
-        e = setup_engine(bio_err, engine, 0);
+        setup_engine(bio_err, engine, 0);
 #endif
 
        if (outfile == NULL)
@@ -269,6 +266,10 @@ bad:
        BIO_printf(bio_err,"Generating RSA private key, %d bit long modulus\n",
                num);
 
+       rsa = RSA_new();
+       if (!rsa)
+               goto err;
+
        if (use_x931)
                {
                BIGNUM *pubexp;