mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-02 02:31:16 +08:00
Fix coredump about HnswFreeElement() (#357)
The HnswInitElement() allocate an element with not initialize value filed, which may has garbage that lead HnswFreeElement() free an invalid pointer.
This commit is contained in:
@@ -177,6 +177,8 @@ HnswInitElement(ItemPointer heaptid, int m, double ml, int maxLevel)
|
||||
|
||||
HnswInitNeighbors(element, m);
|
||||
|
||||
element->value = PointerGetDatum(NULL);
|
||||
|
||||
return element;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user