diff --git a/src/client/src/tscUtil.c b/src/client/src/tscUtil.c index a83d3e62f516b79be23279bd908a16ac4b1bbe87..75b7aecb21cd4608fd2b90f61e3a8e20651cf1a5 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 2d6c513cb57ce1d524a1fb69df68702e624ede7b..007ce0682974d06bf506a82d8bbbc809092eb9e4 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);