aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/database.cc
diff options
context:
space:
mode:
authorGravatar Carl Worth <cworth@cworth.org>2010-09-20 22:01:52 +0000
committerGravatar Carl Worth <cworth@cworth.org>2010-09-20 22:01:52 +0000
commit029830c1f130b3780684d056c01a73061090f15f (patch)
tree680795fbab53074b1a0228c38ecbe37a3dff727c /lib/database.cc
parent341e2bd86e4ed934ae23312779e0b4a0e8c8b4d5 (diff)
lib: Fix use-after-free bug.
Thanks to the new git-based test suite, it's easy to run the whole test suite in valgrind, (simply "make test OPTIONS="--valgrind"), and doing so showed this obvious use-after-free bug, (triggered by the thread-order tests).
Diffstat (limited to 'lib/database.cc')
-rw-r--r--lib/database.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/database.cc b/lib/database.cc
index 6affc205..e4ac970f 100644
--- a/lib/database.cc
+++ b/lib/database.cc
@@ -1300,7 +1300,7 @@ _resolve_message_id_to_thread_id (notmuch_database_t *notmuch,
talloc_free (metadata_key);
- return thread_id;
+ return talloc_strdup (ctx, thread_id);
}
static notmuch_status_t