From c12f1b6e6a53a147c505b461eac1ca84b339b742 Mon Sep 17 00:00:00 2001 From: Ganlin Zhao Date: Mon, 24 Oct 2022 14:16:17 +0800 Subject: [PATCH] fix: coverity issues CID: 399890 --- source/libs/scalar/src/filter.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/libs/scalar/src/filter.c b/source/libs/scalar/src/filter.c index 9e49ae1e03..6f96f6f715 100644 --- a/source/libs/scalar/src/filter.c +++ b/source/libs/scalar/src/filter.c @@ -1135,7 +1135,12 @@ int32_t filterAddUnit(SFilterInfo *info, uint8_t optr, SFilterFieldId *left, SFi int32_t filterAddUnitToGroup(SFilterGroup *group, uint32_t unitIdx) { if (group->unitNum >= group->unitSize) { group->unitSize += FILTER_DEFAULT_UNIT_SIZE; - group->unitIdxs = taosMemoryRealloc(group->unitIdxs, group->unitSize * sizeof(*group->unitIdxs)); + + void *tmp = taosMemoryRealloc(group->unitIdxs, group->unitSize * sizeof(*group->unitIdxs)); + if (tmp == NULL) { + return TSDB_CODE_OUT_OF_MEMORY; + } + group->unitIdxs = tmp; } group->unitIdxs[group->unitNum++] = unitIdx; -- GitLab