Merge pull request #27028 from taosdata/fix/TD-31235

fix(tdb/btree): null txn in btc
This commit is contained in:
Hongze Cheng 2024-08-07 13:45:51 +08:00 committed by GitHub
commit e7720a4402
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 0 deletions

View File

@ -1660,12 +1660,14 @@ int tdbBtcOpen(SBTC *pBtc, SBTree *pBt, TXN *pTxn) {
if (pTxn == NULL) {
TXN *pTxn = tdbOsCalloc(1, sizeof(*pTxn));
if (!pTxn) {
pBtc->pTxn = NULL;
return terrno;
}
int32_t ret = tdbTxnOpen(pTxn, 0, tdbDefaultMalloc, tdbDefaultFree, NULL, 0);
if (ret < 0) {
tdbOsFree(pTxn);
pBtc->pTxn = NULL;
return ret;
}