mirror of
https://github.com/redis/redis.git
synced 2026-10-28 08:25:04 +08:00
Fix null pointer dereference in hnsw_reconnect_nodes() (#15911)
This commit is contained in:
1 parent
3c7e951c3d
commit
558ef8fafb
1 file changed
+1
-1
@@ -1708,13 +1708,13 @@ void hnsw_reconnect_nodes(HNSW *index, hnswNode **nodes, int count, uint32_t lay
|
||||
|
||||
// Step 5: Pair nodes greedily based on scores.
|
||||
int *used = hmalloc(count*sizeof(int));
|
||||
memset(used,0,count*sizeof(int));
|
||||
if (!used) {
|
||||
hfree(distances);
|
||||
hfree(row_avgs);
|
||||
hfree(scores);
|
||||
return;
|
||||
}
|
||||
memset(used,0,count*sizeof(int));
|
||||
|
||||
/* Scan the matrix looking each time for the potential
|
||||
* link with the best score. */
|
||||
|
||||
Reference in new issue
Block a user