fix(query)[TD-32564]. Fix memory leak in exceptional cases
In function tsdbTFileSetInitRef, clear all FileObj stored in the variable lvl when an error occurs, and release the memory allocated for lvl itself.
This commit is contained in:
parent
28ca8ad591
commit
de70067436
|
@ -602,14 +602,14 @@ int32_t tsdbTFileSetInitRef(STsdb *pTsdb, const STFileSet *fset1, STFileSet **fs
|
|||
SSttLvl *lvl;
|
||||
code = tsdbSttLvlInitRef(pTsdb, lvl1, &lvl);
|
||||
if (code) {
|
||||
taosMemoryFree(lvl);
|
||||
tsdbSttLvlClear(&lvl);
|
||||
tsdbTFileSetClear(fset);
|
||||
return code;
|
||||
}
|
||||
|
||||
code = TARRAY2_APPEND(fset[0]->lvlArr, lvl);
|
||||
if (code) {
|
||||
taosMemoryFree(lvl);
|
||||
tsdbSttLvlClear(&lvl);
|
||||
tsdbTFileSetClear(fset);
|
||||
return code;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue