From: Anton Khirnov Date: Sun, 27 Jul 2025 14:11:44 +0000 (+0200) Subject: lib/config: simplify cleanup in notmuch_database_get_config_list() X-Git-Url: https://git.notmuchmail.org/git?a=commitdiff_plain;h=2e87a00f3909e7f5ddd3b51230d8b9483efbf380;p=notmuch lib/config: simplify cleanup in notmuch_database_get_config_list() The list destructor is always set when necessary (i.e. if the iterator is successfully created), so there is never a need to invoke it explicitly, even on failure. --- diff --git a/lib/config.cc b/lib/config.cc index acb397ec..6cc59869 100644 --- a/lib/config.cc +++ b/lib/config.cc @@ -170,14 +170,8 @@ notmuch_database_get_config_list (notmuch_database_t *notmuch, *out = list; DONE: - if (status) { - if (list) { - talloc_free (list); - if (status != NOTMUCH_STATUS_XAPIAN_EXCEPTION) - _notmuch_config_list_destroy (list); - } - } else { - talloc_set_destructor (list, _notmuch_config_list_destroy); + if (status && list) { + talloc_free (list); } return status;