]> git.notmuchmail.org Git - notmuch/blobdiff - lib/database.cc
lib: Fix use-after-free bug.
[notmuch] / lib / database.cc
index 6affc205e4e81b894443722b30f54457ff7669e3..e4ac970f4bc597398750a60ca0988e59c6c700c1 100644 (file)
@@ -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