From e1d7b76adf0d3890f331ef0d219ad62be011d130 Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Thu, 13 Apr 2023 13:26:28 +0800 Subject: [PATCH] fix: array dup issue --- source/util/src/tarray.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/util/src/tarray.c b/source/util/src/tarray.c index 498c4d437b..a786721213 100644 --- a/source/util/src/tarray.c +++ b/source/util/src/tarray.c @@ -312,7 +312,11 @@ SArray* taosArrayFromList(const void* src, size_t size, size_t elemSize) { } SArray* taosArrayDup(const SArray* pSrc, __array_item_dup_fn_t fn) { - if (NULL == pSrc || pSrc->size == 0) { // empty array list + if (NULL == pSrc) { + return NULL; + } + + if (pSrc->size == 0) { // empty array list return taosArrayInit(8, pSrc->elemSize); } -- GitLab