fix:[TD-32452] Clean up when error occurs to avoid mem leak.

This commit is contained in:
Jing Sima 2024-10-08 14:57:04 +08:00
parent b7d7a23eea
commit 83f0601ea9
1 changed files with 2 additions and 1 deletions

View File

@ -3185,7 +3185,8 @@ int32_t firstLastPartialFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) {
} else {
code = colDataSetVal(pCol, pBlock->info.rows, res, false);
if (TSDB_CODE_SUCCESS != code) {
return TSDB_CODE_OUT_OF_MEMORY;
taosMemoryFree(res);
return code;
}
code = setSelectivityValue(pCtx, pBlock, &pRes->pos, pBlock->info.rows);
}