Merge pull request #27016 from taosdata/fix/3.0/TD-31276

fix:[TD-31276] check malloc result.
This commit is contained in:
dapan1121 2024-08-07 16:10:49 +08:00 committed by GitHub
commit ec9a057dde
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 1 deletions

View File

@ -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)