mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-12 15:46:54 +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);
|
HnswInitNeighbors(element, m);
|
||||||
|
|
||||||
|
element->value = PointerGetDatum(NULL);
|
||||||
|
|
||||||
return element;
|
return element;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user