tdb/ofp-recycle: fix mem leaks

This commit is contained in:
Minglei Jin 2023-06-28 13:35:14 +08:00
parent a3c9b17212
commit b2c0bcb1e0
1 changed files with 3 additions and 3 deletions

View File

@ -233,6 +233,7 @@ int tdbBtreeDelete(SBTree *pBt, const void *pKey, int kLen, TXN *pTxn) {
int ret; int ret;
tdbBtcOpen(&btc, pBt, pTxn); tdbBtcOpen(&btc, pBt, pTxn);
btc.coder.ofps = taosArrayInit(8, sizeof(SPgno));
tdbTrace("tdb delete, btc: %p, pTxn: %p", &btc, pTxn); tdbTrace("tdb delete, btc: %p, pTxn: %p", &btc, pTxn);
@ -1317,10 +1318,9 @@ static int tdbBtreeDecodePayload(SPage *pPage, const SCell *pCell, int nHeader,
return -1; return -1;
} }
if (!pDecoder->ofps) { if (pDecoder->ofps) {
pDecoder->ofps = taosArrayInit(8, sizeof(SPgno)); taosArrayPush(pDecoder->ofps, &pgno);
} }
taosArrayPush(pDecoder->ofps, &pgno);
ofpCell = tdbPageGetCell(ofp, 0); ofpCell = tdbPageGetCell(ofp, 0);