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 Sangar3bc7275e2322
diff --git a/src/index.cpp b/src/index.cpp
index d14db052..c9f79b38 100644
--- a/src/index.cpp
+++ b/src/index.cpp
@@ -463,6 +463,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] + "`." :