mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-01 16:35:29 +08:00
add safty check 4 annoy load index (#2009)
Signed-off-by: bo-huang <1013767522@qq.com>
This commit is contained in:
parent
f039032c8c
commit
574ff66c01
@ -1140,6 +1140,10 @@ public:
|
||||
_n_nodes = (S)(index_size / _s);
|
||||
// _nodes = (Node*)malloc(_s * _n_nodes);
|
||||
_nodes = (Node*)malloc((size_t)index_size);
|
||||
if (_nodes == nullptr) {
|
||||
set_error_from_errno(error, "alloc failed when load_index 4 annoy");
|
||||
return false;
|
||||
}
|
||||
memcpy(_nodes, index_data, (size_t)index_size);
|
||||
|
||||
// Find the roots by scanning the end of the file and taking the nodes with most descendants
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user