fix(tsdb/cache): return oom if array or push failed

This commit is contained in:
Minglei Jin 2024-08-09 17:00:18 +08:00
parent 3b80d46b87
commit 105594848c
1 changed files with 7 additions and 1 deletions

View File

@ -1703,8 +1703,14 @@ int32_t tsdbCacheGetBatch(STsdb *pTsdb, tb_uid_t uid, SArray *pLastArray, SCache
if (!remainCols) { if (!remainCols) {
remainCols = taosArrayInit(num_keys, sizeof(SIdxKey)); remainCols = taosArrayInit(num_keys, sizeof(SIdxKey));
if (!remainCols) {
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
}
} }
(void)taosArrayPush(remainCols, &(SIdxKey){i, key}); if (NULL == taosArrayPush(remainCols, &(SIdxKey){i, key})) {
taosArrayDestroy(remainCols);
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
};
} }
} }