diff --git a/source/libs/executor/src/executil.c b/source/libs/executor/src/executil.c index c8d607185e946c9fb96abed2910035dc2427ac32..eb6222f15bccece7c665e17ebb0007ca1cb4bb62 100644 --- a/source/libs/executor/src/executil.c +++ b/source/libs/executor/src/executil.c @@ -449,7 +449,7 @@ SColumnInfoData* getColInfoResult(void* metaHandle, uint64_t suid, SArray* uidLi qDebug("calculate tag block rows:%d, cost:%ld us", rows, st2-st1); end: - taosArrayDestroy(tags); + taosArrayDestroyP(tags, taosMemoryFree); taosHashCleanup(ctx.colHash); taosArrayDestroy(ctx.cInfoList); blockDataDestroy(pResBlock); diff --git a/source/util/src/tarray.c b/source/util/src/tarray.c index 3c4a0a20bdc4f43b14a4f6d476141cb7416db0e6..454739348eec9cd4fa59f5ec359890be2c09c816 100644 --- a/source/util/src/tarray.c +++ b/source/util/src/tarray.c @@ -386,6 +386,7 @@ void* taosArrayDestroy(SArray* pArray) { } void taosArrayDestroyP(SArray* pArray, FDelete fp) { + if(!pArray) return; for (int32_t i = 0; i < pArray->size; i++) { fp(*(void**)TARRAY_GET_ELEM(pArray, i)); }