Move to REF_DEBUG, for consistency.
[openssl.git] / apps / crl2p7.c
index d75b6674a590166d703008852e46d5b3723647e2..74bb8939003924b2656ef604154c402005265e59 100644 (file)
@@ -135,9 +135,10 @@ int crl2pkcs7_main(int argc, char **argv)
             nocrl = 1;
             break;
         case OPT_CERTFILE:
-            if (!certflst && !(certflst = sk_OPENSSL_STRING_new_null()))
+            if ((certflst == NULL)
+                && (certflst = sk_OPENSSL_STRING_new_null()) == NULL)
                 goto end;
-            if (!sk_OPENSSL_STRING_push(certflst, *(++argv))) {
+            if (!sk_OPENSSL_STRING_push(certflst, opt_arg())) {
                 sk_OPENSSL_STRING_free(certflst);
                 goto end;
             }
@@ -148,7 +149,7 @@ int crl2pkcs7_main(int argc, char **argv)
     argv = opt_rest();
 
     if (!nocrl) {
-        in = bio_open_default(infile, RB(informat));
+        in = bio_open_default(infile, 'r', informat);
         if (in == NULL)
             goto end;
 
@@ -197,7 +198,7 @@ int crl2pkcs7_main(int argc, char **argv)
 
     sk_OPENSSL_STRING_free(certflst);
 
-    out = bio_open_default(outfile, WB(outformat));
+    out = bio_open_default(outfile, 'w', outformat);
     if (out == NULL)
         goto end;
 
@@ -215,8 +216,7 @@ int crl2pkcs7_main(int argc, char **argv)
     BIO_free(in);
     BIO_free_all(out);
     PKCS7_free(p7);
-    if (crl != NULL)
-        X509_CRL_free(crl);
+    X509_CRL_free(crl);
 
     return (ret);
 }
@@ -267,7 +267,6 @@ static int add_certs_from_file(STACK_OF(X509) *stack, char *certfile)
  end:
     /* never need to OPENSSL_free x */
     BIO_free(in);
-    if (sk != NULL)
-        sk_X509_INFO_free(sk);
+    sk_X509_INFO_free(sk);
     return (ret);
 }