Merge pull request #28171 from taosdata/fix/TD-32337-3.0
fix: memory leak when alloc error occurs
This commit is contained in:
commit
d948b59e5e
|
@ -71,6 +71,9 @@ static int32_t tsdbSttLvlInitRef(STsdb *pTsdb, const SSttLvl *lvl1, SSttLvl **lv
|
||||||
}
|
}
|
||||||
code = TARRAY2_APPEND(lvl[0]->fobjArr, fobj1);
|
code = TARRAY2_APPEND(lvl[0]->fobjArr, fobj1);
|
||||||
if (code) {
|
if (code) {
|
||||||
|
if (tsdbTFileObjUnref(fobj1) != 0) {
|
||||||
|
tsdbError("failed to unref file obj, fobj:%p", fobj1);
|
||||||
|
}
|
||||||
tsdbSttLvlClear(lvl);
|
tsdbSttLvlClear(lvl);
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue