summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/cms.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/apps/cms.c b/apps/cms.c
index a16318f37c..f93c98ac92 100644
--- a/apps/cms.c
+++ b/apps/cms.c
@@ -628,7 +628,8 @@ int cms_main(int argc, char **argv)
"recipient certificate file");
if (cert == NULL)
goto end;
- sk_X509_push(encerts, cert);
+ if (!sk_X509_push(encerts, cert))
+ goto end;
cert = NULL;
} else {
recipfile = opt_arg();
@@ -837,7 +838,8 @@ int cms_main(int argc, char **argv)
"recipient certificate file");
if (cert == NULL)
goto end;
- sk_X509_push(encerts, cert);
+ if (!sk_X509_push(encerts, cert))
+ goto end;
cert = NULL;
}
}