Merge pull request #27721 from taosdata/fix/TD-31915

fix(tsdb/file2): free fobj if appending failed
This commit is contained in:
Hongze Cheng 2024-09-07 08:55:53 +08:00 committed by GitHub
commit 6722b7788c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 1 deletions

View File

@ -50,7 +50,11 @@ static int32_t tsdbSttLvlInitEx(STsdb *pTsdb, const SSttLvl *lvl1, SSttLvl **lvl
} }
code = TARRAY2_APPEND(lvl[0]->fobjArr, fobj); code = TARRAY2_APPEND(lvl[0]->fobjArr, fobj);
if (code) return code; if (code) {
(void)tsdbSttLvlClear(lvl);
taosMemoryFree(fobj);
return code;
}
} }
return 0; return 0;
} }