X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=lib%2Fquery.cc;h=60ff8bd9a39e1707e12a4e96cff99890b00d669b;hp=69668a451ac7570481792ab5aa4cc81a132f8581;hb=59823f964250be6d0ddbdfc45d4b07803bab267d;hpb=d29d7e1ee25059c657412d5b045650f1e3e1533f diff --git a/lib/query.cc b/lib/query.cc index 69668a45..60ff8bd9 100644 --- a/lib/query.cc +++ b/lib/query.cc @@ -80,7 +80,7 @@ notmuch_query_create (notmuch_database_t *notmuch, if (_debug_query ()) fprintf (stderr, "Query string is:\n%s\n", query_string); - query = talloc (NULL, notmuch_query_t); + query = talloc (notmuch, notmuch_query_t); if (unlikely (query == NULL)) return NULL; @@ -462,6 +462,9 @@ notmuch_threads_valid (notmuch_threads_t *threads) { unsigned int doc_id; + if (! threads) + return FALSE; + while (threads->doc_id_pos < threads->doc_ids->len) { doc_id = g_array_index (threads->doc_ids, unsigned int, threads->doc_id_pos);