Tighten up a memory allocation.
authorCarl Worth <cworth@cworth.org>
Sat, 15 Jan 2011 22:01:43 +0000 (14:01 -0800)
committerCarl Worth <cworth@cworth.org>
Sat, 15 Jan 2011 23:37:43 +0000 (15:37 -0800)
Using the local talloc context ensures that the memory we are using
here will be freed shortly, (rather than hanging on for a long time
with the notmuch database object).

lib/database.cc

index 7a00917ec709ce3f7b30fff2699b993d2860840c..289e41c45bb4d8607fa0c1b31e31fa355bd21d40 100644 (file)
@@ -1710,7 +1710,7 @@ notmuch_database_remove_message (notmuch_database_t *notmuch,
        if (status)
            return status;
 
-       term = talloc_asprintf (notmuch, "%s%s", prefix, direntry);
+       term = talloc_asprintf (local, "%s%s", prefix, direntry);
 
        find_doc_ids_for_term (notmuch, term, &i, &end);