cert_sk isn't always allocated, so freeing it may cause a crash.
authorRichard Levitte <levitte@openssl.org>
Thu, 30 Jan 2003 10:27:47 +0000 (10:27 +0000)
committerRichard Levitte <levitte@openssl.org>
Thu, 30 Jan 2003 10:27:47 +0000 (10:27 +0000)
PR: 481

apps/ca.c

index 0182b9e718927980b5ffc6a8c6eb31221e704820..2bc5435bb1316f8a3ef120aaa4bb1a8ed764fa10 100644 (file)
--- a/apps/ca.c
+++ b/apps/ca.c
@@ -1636,7 +1636,8 @@ err:
        BIO_free_all(out);
        BIO_free_all(in);
 
-       sk_X509_pop_free(cert_sk,X509_free);
+       if (cert_sk)
+               sk_X509_pop_free(cert_sk,X509_free);
 
        if (ret) ERR_print_errors(bio_err);
        app_RAND_write_file(randfile, bio_err);