Fix some memory leaks in the openssl app
[openssl.git] / apps / gendsa.c
index bd8aecedbd9c695285e7324db3901be2666e1b9f..b6d1d0f5b3f76ab0b0a6eb1834af77ec6fb3762c 100644 (file)
@@ -148,6 +148,8 @@ int gendsa_main(int argc, char **argv)
         goto end;
     }
     pkey = app_keygen(ctx, "DSA", nbits, verbose);
+    if (pkey == NULL)
+        goto end;
 
     assert(private);
     if (!PEM_write_bio_PrivateKey(out, pkey, enc, NULL, 0, NULL, passout)) {