Merge pull request #27016 from taosdata/fix/3.0/TD-31276
fix:[TD-31276] check malloc result.
This commit is contained in:
commit
ec9a057dde
|
@ -464,7 +464,7 @@ struct SFilterInfo {
|
||||||
(colInfo).type = RANGE_TYPE_UNIT; \
|
(colInfo).type = RANGE_TYPE_UNIT; \
|
||||||
(colInfo).dataType = FILTER_UNIT_DATA_TYPE(u); \
|
(colInfo).dataType = FILTER_UNIT_DATA_TYPE(u); \
|
||||||
if (taosArrayPush((SArray *)((colInfo).info), &u) == NULL) { \
|
if (taosArrayPush((SArray *)((colInfo).info), &u) == NULL) { \
|
||||||
FLT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY); \
|
FLT_ERR_RET(terrno); \
|
||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
#define FILTER_PUSH_VAR_HASH(colInfo, ha) \
|
#define FILTER_PUSH_VAR_HASH(colInfo, ha) \
|
||||||
|
@ -481,6 +481,9 @@ struct SFilterInfo {
|
||||||
#define FILTER_COPY_IDX(dst, src, n) \
|
#define FILTER_COPY_IDX(dst, src, n) \
|
||||||
do { \
|
do { \
|
||||||
*(dst) = taosMemoryMalloc(sizeof(uint32_t) * n); \
|
*(dst) = taosMemoryMalloc(sizeof(uint32_t) * n); \
|
||||||
|
if (NULL == *(dst)) { \
|
||||||
|
FLT_ERR_JRET(terrno); \
|
||||||
|
} \
|
||||||
(void)memcpy(*(dst), src, sizeof(uint32_t) * n); \
|
(void)memcpy(*(dst), src, sizeof(uint32_t) * n); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue