fix(tsdb/cache): return oom if array or push failed
This commit is contained in:
parent
3b80d46b87
commit
105594848c
|
@ -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);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue