summaryrefslogtreecommitdiffstats
path: root/apps/crl2pkcs7.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--apps/crl2pkcs7.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/crl2pkcs7.c b/apps/crl2pkcs7.c
index 681c60285f..ba24d31d5f 100644
--- a/apps/crl2pkcs7.c
+++ b/apps/crl2pkcs7.c
@@ -216,7 +216,10 @@ static int add_certs_from_file(STACK_OF(X509) *stack, char *certfile)
while (sk_X509_INFO_num(sk)) {
xi = sk_X509_INFO_shift(sk);
if (xi->x509 != NULL) {
- sk_X509_push(stack, xi->x509);
+ if (!sk_X509_push(stack, xi->x509)) {
+ X509_INFO_free(xi);
+ goto end;
+ }
xi->x509 = NULL;
count++;
}