David Bremner <david@tethera.net> writes: > + talloc_set_destructor (list, _notmuch_config_list_destroy); > + list->iterator = new Xapian::TermIterator; > + list->notmuch = notmuch; > + list->current_key = NULL; > + list->current_val = NULL; > + > + try { > + > + *list->iterator = notmuch->xapian_db->metadata_keys_begin (CONFIG_PREFIX + (prefix ? prefix : "")); > + minimally these two assignments to list->iterator should be right next to each other, with a comment explaining what the heck. But I think the following is more idiomatic - /* force copying onto the heap */ - list->iterator = new Xapian::TermIterator; - *list->iterator = notmuch->xapian_db->metadata_keys_begin (CONFIG_PREFIX + (prefix ? prefix : "")); + list->iterator = new Xapian::TermIterator(notmuch->xapian_db->metadata_keys_begin + (CONFIG_PREFIX + (prefix ? prefix : ""))); so that's what I've done in git