query: bind queries to database objects

The queries don't really work after a database is closed, and we would
like them to be freed if the database is destroyed.

Acknowledged-by: David Bremner <david@tethera.net>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
This commit is contained in:
Felipe Contreras 2013-09-30 11:04:21 -05:00
parent 1eecfbd51a
commit fd733a4f5c

View file

@ -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;