From: William Lallemand Date: Mon, 30 Mar 2020 16:19:43 +0000 (+0200) Subject: MINOR: ssl: use crtlist_free() upon error in directory loading X-Git-Tag: v2.2-dev6~67 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=09bd5a07872a56678f3e152ed4d627159bb917a7;p=thirdparty%2Fhaproxy.git MINOR: ssl: use crtlist_free() upon error in directory loading Replace the manual cleaninp which is done in crtlist_load_cert_dir() by a call to the crtlist_free() function. --- diff --git a/src/ssl_sock.c b/src/ssl_sock.c index 4ceb21c5fa..f799ca8af0 100644 --- a/src/ssl_sock.c +++ b/src/ssl_sock.c @@ -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; }