From: Fabian Keil <fk@fabiankeil.de>
Date: Thu, 14 May 2020 11:51:52 +0000 (+0200)
Subject: Simplify free_certificate_chain()
X-Git-Tag: v_3_0_29~422
X-Git-Url: http://www.privoxy.org/gitweb/@default-cgi@/static/developer-manual/documentation.html?a=commitdiff_plain;h=827cc96b850e1e38cdfa7d97c796878c0b6be752;p=privoxy.git

Simplify free_certificate_chain()

Sponsored by: Robert Klemme
---

diff --git a/ssl.c b/ssl.c
index 32b51ad0..05122752 100644
--- a/ssl.c
+++ b/ssl.c
@@ -2172,14 +2172,11 @@ static void free_certificate_chain(struct client_state *csp)
    csp->server_certs_chain.next = NULL;
 
    /* Freeing memory in whole linked list */
-   if (cert != NULL)
+   while (cert != NULL)
    {
-      do
-      {
-         struct certs_chain *cert_for_free = cert;
-         cert = cert->next;
-         freez(cert_for_free);
-      } while (cert != NULL);
+      struct certs_chain *cert_for_free = cert;
+      cert = cert->next;
+      freez(cert_for_free);
    }
 }