From 029830c1f130b3780684d056c01a73061090f15f Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Mon, 20 Sep 2010 22:01:52 +0000 Subject: [PATCH] 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). --- lib/database.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.43.0