mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-21 18:38:08 +01:00
lib/config: delay setting talloc destructor
If Xapian has thrown an exception, it is not safe to invoke the destructor when freeing the list struct.
This commit is contained in:
parent
3b40978241
commit
43ba5ed7ec
1 changed files with 9 additions and 2 deletions
|
@ -133,8 +133,15 @@ notmuch_database_get_config_list (notmuch_database_t *notmuch,
|
|||
*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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue