diff --git a/xapian-core/matcher/queryoptimiser.h b/xapian-core/matcher/queryoptimiser.h
index 5ca302a00a0c..9a1b520530b2 100644
a
|
b
|
class QueryOptimiser {
|
158 | 158 | |
159 | 159 | void destroy_postlist(PostList* pl) { |
160 | 160 | if (!pl) return; |
161 | | if (pl == static_cast<PostList*>(hint)) { |
162 | | hint_owned = true; |
163 | | } else { |
164 | | if (!hint_owned) { |
165 | | // The hint could be a subpostlist of pl, but we can't easily |
166 | | // tell so we have to do the safe thing and reset it. |
167 | | // |
168 | | // This isn't ideal, but it's much better than use-after-free |
169 | | // bugs. |
170 | | hint = nullptr; |
171 | | } |
172 | | delete pl; |
173 | | } |
| 161 | set_hint_postlist(nullptr); |
174 | 162 | // Remove the EstimateOp (and any sub-ops) which we generated for this |
175 | 163 | // PostList. |
176 | 164 | localsubmatch.pop_op(); |