aboutsummaryrefslogtreecommitdiff
path: root/lib/config.cc
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2025-07-27 16:11:44 +0200
committerDavid Bremner <david@tethera.net>2025-08-04 10:15:38 -0300
commit2e87a00f3909e7f5ddd3b51230d8b9483efbf380 (patch)
treef3b90b71d6dddf8c2d1f846788c6aa5772a40285 /lib/config.cc
parentf375ea1add121c428f261473512831a169dfe335 (diff)
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.
Diffstat (limited to 'lib/config.cc')
-rw-r--r--lib/config.cc10
1 files changed, 2 insertions, 8 deletions
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;