From 626cd4cc58810249bb65d53209543bd4bff537fb Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Tue, 7 Sep 2021 17:06:07 +0800 Subject: [PATCH] [td-255] merge develop. --- src/client/src/tscUtil.c | 1 + src/util/src/tarray.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/client/src/tscUtil.c b/src/client/src/tscUtil.c index a83d3e62f5..75b7aecb21 100644 --- a/src/client/src/tscUtil.c +++ b/src/client/src/tscUtil.c @@ -3618,6 +3618,7 @@ SSqlObj* createSubqueryObj(SSqlObj* pSql, int16_t tableIndex, __async_cb_func_t pNew->pTscObj = pSql->pTscObj; pNew->signature = pNew; + pNew->sqlstr = strdup(pSql->sqlstr); tsem_init(&pNew->rspSem, 0, 0); SSqlCmd* pnCmd = &pNew->cmd; diff --git a/src/util/src/tarray.c b/src/util/src/tarray.c index 2d6c513cb5..007ce06829 100644 --- a/src/util/src/tarray.c +++ b/src/util/src/tarray.c @@ -24,11 +24,12 @@ void* taosArrayInit(size_t size, size_t elemSize) { size = TARRAY_MIN_SIZE; } - SArray* pArray = calloc(1, sizeof(SArray)); + SArray* pArray = malloc(sizeof(SArray)); if (pArray == NULL) { return NULL; } + pArray->size = 0; pArray->pData = calloc(size, elemSize); if (pArray->pData == NULL) { free(pArray); -- GitLab