mirror of https://github.com/redis/redis.git
Fix missing prev update in hnsw_cursor_free causing unlink failure (#14050)
This PR fixes a bug in the `hnsw_cursor_free` function where the prev pointer was never updated during cursor list traversal. As a result, if the cursor being freed was not the head of the list, it would not be correctly unlinked, potentially causing memory leaks or corruption of the cursor list. Note that since `hnsw_cursor_free()` is never used for now, this PR does not actually fix any bug.
This commit is contained in:
parent
e2b8f8ff6d
commit
38d16a82eb
|
@ -2489,6 +2489,7 @@ void hnsw_cursor_free(hnswCursor *cursor) {
|
|||
hfree(cursor);
|
||||
break;
|
||||
}
|
||||
prev = x;
|
||||
x = x->next;
|
||||
}
|
||||
pthread_rwlock_unlock(&cursor->index->global_lock);
|
||||
|
|
Loading…
Reference in New Issue