free NULL cleanup -- coda
[openssl.git] / apps / s_cb.c
index 1f2d3719520ed6a9df6568d419c0cfe3c3380ce9..13a3a25652bca60d700f582cec347a2d18c8b494 100644 (file)
@@ -1202,6 +1202,9 @@ static int ssl_excert_prepend(SSL_EXCERT **pexc)
 void ssl_excert_free(SSL_EXCERT *exc)
 {
     SSL_EXCERT *curr;
+
+    if (!exc)
+        return;
     while (exc) {
         X509_free(exc->cert);
         EVP_PKEY_free(exc->key);
@@ -1311,8 +1314,7 @@ int args_excert(int opt, SSL_EXCERT **pexc)
 
  err:
     ERR_print_errors(bio_err);
-    if (exc)
-        ssl_excert_free(exc);
+    ssl_excert_free(exc);
     *pexc = NULL;
     return 0;
 }