*out = list;
DONE:
- if (status && list)
- talloc_free (list);
+ 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);
+ }
return status;
}