diff options
author | Iain Buclaw <ibuclaw@gdcproject.org> | 2020-08-07 23:41:52 +0200 |
---|---|---|
committer | Iain Buclaw <ibuclaw@gdcproject.org> | 2020-08-07 23:43:48 +0200 |
commit | fb64e8c018f7d78f5e8945a755a7c8b58950afed (patch) | |
tree | d0f46c0906919c2b75e08359788e0b009af1c78d /src/modes/thread_index/query_loader.cc | |
parent | d219f7674b2c970e8dd1b1ab5c24a4e1f31fe722 (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.
Diffstat (limited to 'src/modes/thread_index/query_loader.cc')
-rw-r--r-- | src/modes/thread_index/query_loader.cc | 2 |
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) { |