]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: ssl: use crtlist_free() upon error in directory loading
authorWilliam Lallemand <wlallemand@haproxy.com>
Mon, 30 Mar 2020 16:19:43 +0000 (18:19 +0200)
committerWilliam Lallemand <wlallemand@haproxy.org>
Tue, 31 Mar 2020 10:32:17 +0000 (12:32 +0200)
Replace the manual cleaninp which is done in crtlist_load_cert_dir() by
a call to the crtlist_free() function.

src/ssl_sock.c

index 4ceb21c5fa8c2b093d060220d5e44840c160dcc5..f799ca8af0b56a260ec925c14033d66aaa3198d0 100644 (file)
@@ -4674,18 +4674,7 @@ end:
 
        if (cfgerr & ERR_CODE) {
                /* free the dir and entries on error */
-               struct ebpt_node *node;
-
-               node = ebpt_first(&dir->entries);
-               while (node) {
-                       struct crtlist_entry *entry;
-
-                       entry = ebpt_entry(node, typeof(*entry), node);
-                       node = ebpt_next(node);
-                       ebpt_delete(&entry->node);
-                       free(entry);
-               }
-               free(dir);
+               crtlist_free(dir);
        } else {
                *crtlist = dir;
        }