Fix dsaparam -genkey with DER outform
[openssl.git] / apps / dsa.c
index 4ed21d891e8698f5c852bb10a02098e6ae24173e..82a870eb291004f8992e52a79d3b0ff19f7e05e0 100644 (file)
@@ -327,6 +327,9 @@ int MAIN(int argc, char **argv)
     } else if (outformat == FORMAT_MSBLOB || outformat == FORMAT_PVK) {
         EVP_PKEY *pk;
         pk = EVP_PKEY_new();
+        if (pk == NULL)
+           goto end;
+
         EVP_PKEY_set1_DSA(pk, dsa);
         if (outformat == FORMAT_PVK)
             i = i2b_PVK_bio(out, pk, pvk_encr, 0, passout);