From 350e5d777e161f87553c2e6e190ad15b3ca1386d Mon Sep 17 00:00:00 2001 From: Dan Dees Date: Thu, 8 Jan 2026 07:53:27 +0700 Subject: [PATCH] Fix gds__free after default pool cleanup Check the default pool pointer directly in gds__free. getDefaultMemoryPool() asserts that the pool still exists, so the previous null check did not protect the late process-exit path in debug builds. --- src/yvalve/gds.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/yvalve/gds.cpp b/src/yvalve/gds.cpp index adf40ec7e05..a5e40c8ef32 100644 --- a/src/yvalve/gds.cpp +++ b/src/yvalve/gds.cpp @@ -287,7 +287,10 @@ VoidPtr API_ROUTINE gds__alloc_debug(SLONG size_request, const TEXT* filename, U ULONG API_ROUTINE gds__free(void* blk) { - getDefaultMemoryPool()->deallocate(blk); + if (Firebird::MemoryPool* pool = Firebird::MemoryPool::defaultMemoryManager) + { + pool->deallocate(blk); + } return 0; }