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.
This commit is contained in:
William Lallemand 2020-03-30 18:19:43 +02:00 committed by William Lallemand
parent 4c68bba5c1
commit 09bd5a0787

View File

@ -4674,18 +4674,7 @@ end:
if (cfgerr & ERR_CODE) { if (cfgerr & ERR_CODE) {
/* free the dir and entries on error */ /* free the dir and entries on error */
struct ebpt_node *node; crtlist_free(dir);
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);
} else { } else {
*crtlist = dir; *crtlist = dir;
} }