summaryrefslogtreecommitdiffstats
path: root/apps/genpkey.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/genpkey.c')
-rw-r--r--apps/genpkey.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/apps/genpkey.c b/apps/genpkey.c
index 5a59dae681..080f1f6075 100644
--- a/apps/genpkey.c
+++ b/apps/genpkey.c
@@ -234,6 +234,8 @@ int genpkey_main(int argc, char **argv)
pkey = do_param ? app_paramgen(ctx, algname)
: app_keygen(ctx, algname, 0, 0 /* not verbose */);
+ if (pkey == NULL)
+ goto end;
if (do_param) {
rv = PEM_write_bio_Parameters(out, pkey);