aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2009-10-27 12:00:58 -0700
committerCarl Worth <cworth@cworth.org>2009-10-27 12:00:58 -0700
commit16003e1f8f22a4a1e2a63c89941565ae1a7b320b (patch)
treef1840fb4eb6bee0f278f5eb11455e101a91f28cd
parentae0bd3f503c8815affa733f48498bb77d023680b (diff)
Unbreak the "notmuch setup" command.
The recent addition of support for automatically adding tags to new messages for "notmuch new" caused "notmuch setup" to segfault. The fix is simple, (just need to move a destroy function to inside a nearby if block). Did I mention recently we need to add a test suite?
-rw-r--r--notmuch.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/notmuch.c b/notmuch.c
index f620f58..ca30b52 100644
--- a/notmuch.c
+++ b/notmuch.c
@@ -264,9 +264,10 @@ add_files_recursive (notmuch_database_t *notmuch,
/* success */
case NOTMUCH_STATUS_SUCCESS:
state->added_messages++;
- if (state->callback)
+ if (state->callback) {
(state->callback) (message);
- notmuch_message_destroy (message);
+ notmuch_message_destroy (message);
+ }
break;
/* Non-fatal issues (go on to next file) */
case NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID: