Fix use after free with WILDCARD_LIMIT_MOST_FREQUENT
commit2299e1d21e39f1295c81833ccd5037f746f4744a
authorOlly Betts <olly@survex.com>
Mon, 23 Nov 2015 02:29:44 +0000 (23 15:29 +1300)
committerOlly Betts <olly@survex.com>
Mon, 23 Nov 2015 02:29:44 +0000 (23 15:29 +1300)
tree4786917516af8ba00e8f05023d4ad5322169e130
parenta089ccdadcd2bbe5696d5020bd50c336af76c3aa
Fix use after free with WILDCARD_LIMIT_MOST_FREQUENT

If we tried to open a postlist after processing such a wildcard, the
postlist hint could be pointing to a PostList object which had been
deleted.

We now let the QueryOptimiser take ownership of the postlist in this
situation.

Fixes #696, reported by coventry.
xapian-core/api/queryinternal.cc
xapian-core/matcher/localsubmatch.cc
xapian-core/matcher/localsubmatch.h
xapian-core/matcher/queryoptimiser.h
xapian-core/tests/api_query.cc