mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-25 04:18:08 +01:00
new: Fix missing end_atomic in remove_filename on error
Previously, if we failed to find the message by filename in remove_filename, we would return immediately from the function without ending its atomic block. Now this code follows the usual goto DONE idiom to perform cleanup.
This commit is contained in:
parent
746fef0aea
commit
2e7b649404
1 changed files with 4 additions and 1 deletions
|
@ -779,7 +779,8 @@ remove_filename (notmuch_database_t *notmuch,
|
||||||
return status;
|
return status;
|
||||||
status = notmuch_database_find_message_by_filename (notmuch, path, &message);
|
status = notmuch_database_find_message_by_filename (notmuch, path, &message);
|
||||||
if (status || message == NULL)
|
if (status || message == NULL)
|
||||||
return status;
|
goto DONE;
|
||||||
|
|
||||||
status = notmuch_database_remove_message (notmuch, path);
|
status = notmuch_database_remove_message (notmuch, path);
|
||||||
if (status == NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID) {
|
if (status == NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID) {
|
||||||
add_files_state->renamed_messages++;
|
add_files_state->renamed_messages++;
|
||||||
|
@ -790,6 +791,8 @@ remove_filename (notmuch_database_t *notmuch,
|
||||||
add_files_state->removed_messages++;
|
add_files_state->removed_messages++;
|
||||||
}
|
}
|
||||||
notmuch_message_destroy (message);
|
notmuch_message_destroy (message);
|
||||||
|
|
||||||
|
DONE:
|
||||||
notmuch_database_end_atomic (notmuch);
|
notmuch_database_end_atomic (notmuch);
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue