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

apps/ca.c

index 028dd98d31cf40bc5b1dd9e73f6bd70ac354c4d7..2a56e556a391452b325e867dbdc0980b184a784f 100644 (file)
--- a/apps/ca.c
+++ b/apps/ca.c
@@ -1641,7 +1641,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);