Skip to content

Commit fb64e8c

Browse files
committed
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.
1 parent d219f76 commit fb64e8c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/modes/thread_index/query_loader.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ namespace Astroid {
123123
if (!in_destructor) stats_ready.emit ();
124124

125125
/* set up query */
126-
notmuch_threads_t * threads;
126+
notmuch_threads_t * threads = NULL;
127127

128128
notmuch_query_t * nmquery = notmuch_query_create (db.nm_db, query.c_str ());
129129
for (ustring & t : db.excluded_tags) {

0 commit comments

Comments
 (0)