Merge pull request #27130 from taosdata/fix/TD-31318

fix(tsdb/cache): return oom if array or push failed
This commit is contained in:
Hongze Cheng 2024-08-12 09:09:20 +08:00 committed by GitHub
commit 4efa935e8b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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) {
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);
};
}
}