mirror of
https://github.com/typesense/typesense.git
synced 2025-05-21 14:12:27 +08:00
fix memory leak.
This commit is contained in:
parent
b1ef695461
commit
57908965ae
@ -3857,6 +3857,7 @@ Option<bool> Collection::prune_doc(nlohmann::json& doc,
|
||||
}
|
||||
|
||||
if (documents[0].first == 0) {
|
||||
delete[] documents[0].second;
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -3879,6 +3880,8 @@ Option<bool> Collection::prune_doc(nlohmann::json& doc,
|
||||
reference_docs.push_back(ref_doc);
|
||||
}
|
||||
|
||||
delete[] documents[0].second;
|
||||
|
||||
for (const auto &ref_doc: reference_docs) {
|
||||
doc.update(ref_doc);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user