From 18e31f8e26de2b0f84e130e18ffb0f6861e5a764 Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Sun, 9 Oct 2022 15:50:22 +0800 Subject: [PATCH] more fix --- source/libs/tdb/src/db/tdbPCache.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/libs/tdb/src/db/tdbPCache.c b/source/libs/tdb/src/db/tdbPCache.c index bacf41357c..b6d1f95c0e 100644 --- a/source/libs/tdb/src/db/tdbPCache.c +++ b/source/libs/tdb/src/db/tdbPCache.c @@ -139,8 +139,11 @@ static int tdbPCacheAlterImpl(SPCache *pCache, int32_t nPage) { int32_t iPage = (*ppPage)->id; if (iPage >= nPage) { + SPage *pPage = *ppPage; + *ppPage = pPage->pFreeNext; + pCache->aPage[pPage->id] = NULL; + tdbPageDestroy(pPage, tdbDefaultFree, NULL); pCache->nFree--; - *ppPage = (*ppPage)->pFreeNext; } else { ppPage = &(*ppPage)->pFreeNext; } -- GitLab