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:
Japin Li
2023-11-16 08:19:59 +08:00
committed by GitHub
parent 3263b350f5
commit 4549e8aeb1

View File

@@ -177,6 +177,8 @@ HnswInitElement(ItemPointer heaptid, int m, double ml, int maxLevel)
HnswInitNeighbors(element, m);
element->value = PointerGetDatum(NULL);
return element;
}