Skip to content

Open Source alternative to Algolia + Pinecone and an Easier-to-Use alternative to ElasticSearch ⚡ 🔍 ✨ Fast, typo tolerant, in-memory fuzzy Search Engine for building delightful search experiences

Fix memory leak.

Harpreet Sangar1c6e882ca66f
diff --git a/src/index.cpp b/src/index.cpp
index 1fd59e16..e58c28b6 100644
--- a/src/index.cpp
+++ b/src/index.cpp
@@ -464,6 +464,7 @@ Option<uint32_t> Index::validate_index_in_memory(nlohmann::json& document, uint3
collection->get_filter_ids(referenced_field_name + ":=" + value, documents);
if (documents[0].first != 1) {
+ delete [] documents[0].second;
auto match = " `" + referenced_field_name + "` = `" + value + "` ";
return Option<>(400, documents[0].first < 1 ?
"Referenced document having" + match + "not found in the collection `" + tokens[0] + "`." :