From e05169ccc6caafb0af5f5bad8cd553d507d98d04 Mon Sep 17 00:00:00 2001 From: Minglei Jin Date: Thu, 25 Aug 2022 17:31:40 +0800 Subject: [PATCH] fix: free ofp large value's memory --- source/libs/tdb/src/db/tdbBtree.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/libs/tdb/src/db/tdbBtree.c b/source/libs/tdb/src/db/tdbBtree.c index 2ab5fd2e9c..4701318779 100644 --- a/source/libs/tdb/src/db/tdbBtree.c +++ b/source/libs/tdb/src/db/tdbBtree.c @@ -782,6 +782,11 @@ static int tdbBtreeBalanceNonRoot(SBTree *pBt, SPage *pParent, int idx, TXN *pTx pBt); tdbPageInsertCell(pParent, sIdx++, pNewCell, szNewCell, 0); tdbOsFree(pNewCell); + + if (TDB_CELLDECODER_FREE_VAL(&cd)) { + tdbFree(cd.pVal); + cd.pVal = NULL; + } } // move to next new page