Merge pull request #21167 from taosdata/fix/TD-23953

fix(tdb/decoder): free decoder's value if not needed by user
This commit is contained in:
wade zhang 2023-05-06 08:32:29 +08:00 committed by GitHub
commit 2025aa5650
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -1814,6 +1814,11 @@ int tdbBtreeNext(SBTC *pBtc, void **ppKey, int *kLen, void **ppVal, int *vLen) {
*ppVal = pVal; *ppVal = pVal;
*vLen = cd.vLen; *vLen = cd.vLen;
} else {
if (TDB_CELLDECODER_FREE_VAL(&cd)) {
tdbTrace("tdb/btree-next2 decoder: %p pVal free: %p", &cd, cd.pVal);
tdbFree(cd.pVal);
}
} }
ret = tdbBtcMoveToNext(pBtc); ret = tdbBtcMoveToNext(pBtc);