mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-24 20:08:10 +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.
(cherry picked from commit 43ba5ed7ec
)
This commit is contained in:
parent
17540b73e8
commit
2702050340
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