[openssl-commits] [openssl] master update

Kurt Roeckx kurt at openssl.org
Mon Aug 22 19:33:13 UTC 2016


The branch master has been updated
       via  2d87ee68257683c1bb54ad77dde1b07dbb69521d (commit)
      from  1c55e372b9e16049461caa4802e801cc945018d0 (commit)


- Log -----------------------------------------------------------------
commit 2d87ee68257683c1bb54ad77dde1b07dbb69521d
Author: FdaSilvaYY <fdasilvayy at gmail.com>
Date:   Sat Aug 20 18:31:45 2016 +0200

    Closing output file from inside the loop who open it
    
    Signed-off-by: Kurt Roeckx <kurt at roeckx.be>
    Reviewed-by: Rich Salz <rsalz at openssl.org>
    
    GH: #1471

-----------------------------------------------------------------------

Summary of changes:
 apps/ca.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/apps/ca.c b/apps/ca.c
index 3db3f99..34dfd9b 100644
--- a/apps/ca.c
+++ b/apps/ca.c
@@ -224,7 +224,7 @@ int ca_main(int argc, char **argv)
     ENGINE *e = NULL;
     BIGNUM *crlnumber = NULL, *serial = NULL;
     EVP_PKEY *pkey = NULL;
-    BIO *in = NULL, *out = NULL, *Sout = NULL, *Cout = NULL;
+    BIO *in = NULL, *out = NULL, *Sout = NULL;
     ASN1_INTEGER *tmpser;
     ASN1_TIME *tmptm;
     CA_DB *db = NULL;
@@ -982,6 +982,7 @@ end_of_options:
         if (verbose)
             BIO_printf(bio_err, "writing new certificates\n");
         for (i = 0; i < sk_X509_num(cert_sk); i++) {
+            BIO *Cout = NULL;
             ASN1_INTEGER *serialNumber = X509_get_serialNumber(x);
             int k;
             char *n;
@@ -1031,6 +1032,7 @@ end_of_options:
             }
             write_new_certificate(Cout, x, 0, notext);
             write_new_certificate(Sout, x, output_der, notext);
+            BIO_free_all(Cout);
         }
 
         if (sk_X509_num(cert_sk)) {
@@ -1215,7 +1217,6 @@ end_of_options:
     /*****************************************************************/
     ret = 0;
  end:
-    BIO_free_all(Cout);
     BIO_free_all(Sout);
     BIO_free_all(out);
     BIO_free_all(in);


More information about the openssl-commits mailing list