Replace the manual cleaninp which is done in crtlist_load_cert_dir() by
a call to the crtlist_free() function.
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;
}