From 58f3bb528d59007ea7a36f4134c79420fb40a841 Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Fri, 4 Dec 2026 04:53:52 -0800 Subject: [PATCH] Fixed pointer reset if no entry point --- src/hnswvacuum.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/hnswvacuum.c b/src/hnswvacuum.c index 683ca06c..984110cc 100644 --- a/src/hnswvacuum.c +++ b/src/hnswvacuum.c @@ -272,8 +272,11 @@ RepairGraphElement(HnswVacuumState * vacuumstate, HnswElement element, HnswEleme /* Reset pointers for safety */ HnswPtrStore(base, element->neighbors, (HnswNeighborArrayPtr *) NULL); HnswPtrStore(base, element->value, (char *) NULL); - HnswPtrStore(base, entryPoint->neighbors, (HnswNeighborArrayPtr *) NULL); - HnswPtrStore(base, entryPoint->value, (char *) NULL); + if (entryPoint != NULL) + { + HnswPtrStore(base, entryPoint->neighbors, (HnswNeighborArrayPtr *) NULL); + HnswPtrStore(base, entryPoint->value, (char *) NULL); + } /* Reset memory context */ MemoryContextSwitchTo(oldCtx);