mirror of
https://github.com/typesense/typesense.git
synced 2025-05-21 06:02:26 +08:00
Fix asan warnings.
This commit is contained in:
parent
accfc4d1e2
commit
80641096c9
@ -736,7 +736,7 @@ struct sort_by {
|
||||
};
|
||||
|
||||
struct eval_t {
|
||||
filter_node_t* filter_tree_root;
|
||||
filter_node_t* filter_tree_root = nullptr;
|
||||
uint32_t* ids = nullptr;
|
||||
uint32_t size = 0;
|
||||
};
|
||||
|
@ -27,6 +27,7 @@ struct sort_fields_guard_t {
|
||||
|
||||
~sort_fields_guard_t() {
|
||||
for(auto& sort_by_clause: sort_fields_std) {
|
||||
delete sort_by_clause.eval.filter_tree_root;
|
||||
if(sort_by_clause.eval.ids) {
|
||||
delete [] sort_by_clause.eval.ids;
|
||||
sort_by_clause.eval.ids = nullptr;
|
||||
@ -1541,6 +1542,11 @@ Option<nlohmann::json> Collection::search(std::string raw_query,
|
||||
std::unique_ptr<search_args> search_params_guard(search_params);
|
||||
|
||||
auto search_op = index->run_search(search_params, name);
|
||||
|
||||
// filter_tree_root might be updated in Index::static_filter_query_eval.
|
||||
filter_tree_root_guard.release();
|
||||
filter_tree_root_guard.reset(filter_tree_root);
|
||||
|
||||
if (!search_op.ok()) {
|
||||
return Option<nlohmann::json>(search_op.code(), search_op.error());
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user