summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIain Buclaw <ibuclaw@gdcproject.org>2020-08-07 23:41:52 +0200
committerIain Buclaw <ibuclaw@gdcproject.org>2020-08-07 23:43:48 +0200
commitfb64e8c018f7d78f5e8945a755a7c8b58950afed (patch)
treed0f46c0906919c2b75e08359788e0b009af1c78d
parentd219f7674b2c970e8dd1b1ab5c24a4e1f31fe722 (diff)
ql: Default initialize threads to NULL.
The function notmuch_query_search_threads() only sets the pointer on success. Not initializing the pointer could result in an abort or segfault inside notmuch_threads_destroy() due to it pointing to whatever was previously on the stack.
-rw-r--r--src/modes/thread_index/query_loader.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/modes/thread_index/query_loader.cc b/src/modes/thread_index/query_loader.cc
index 40f384b..39c2fb8 100644
--- a/src/modes/thread_index/query_loader.cc
+++ b/src/modes/thread_index/query_loader.cc
@@ -123,7 +123,7 @@ namespace Astroid {
if (!in_destructor) stats_ready.emit ();
/* set up query */
- notmuch_threads_t * threads;
+ notmuch_threads_t * threads = NULL;
notmuch_query_t * nmquery = notmuch_query_create (db.nm_db, query.c_str ());
for (ustring & t : db.excluded_tags) {