From c0aff8098d64cb807682a8ce450d1d9ca87aee2a Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Tue, 7 Sep 2021 17:16:56 +0800 Subject: [PATCH] [td-255]refactor. --- src/client/src/tscUtil.c | 3 +-- src/inc/taosmsg.h | 7 +------ 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/client/src/tscUtil.c b/src/client/src/tscUtil.c index 75b7aecb21..a9b74ecb86 100644 --- a/src/client/src/tscUtil.c +++ b/src/client/src/tscUtil.c @@ -4407,7 +4407,7 @@ SVgroupsInfo* tscVgroupInfoClone(SVgroupsInfo *vgroupList) { } size_t size = sizeof(SVgroupsInfo) + sizeof(SVgroupMsg) * vgroupList->numOfVgroups; - SVgroupsInfo* pNew = calloc(1, size); + SVgroupsInfo* pNew = malloc(size); if (pNew == NULL) { return NULL; } @@ -4422,7 +4422,6 @@ SVgroupsInfo* tscVgroupInfoClone(SVgroupsInfo *vgroupList) { pNewVInfo->numOfEps = pvInfo->numOfEps; for(int32_t j = 0; j < pvInfo->numOfEps; ++j) { -// pNewVInfo->epAddr[j].fqdn = strdup(pvInfo->epAddr[j].fqdn); pNewVInfo->epAddr[j].port = pvInfo->epAddr[j].port; tstrncpy(pNewVInfo->epAddr[j].fqdn, pvInfo->epAddr[j].fqdn, TSDB_FQDN_LEN); } diff --git a/src/inc/taosmsg.h b/src/inc/taosmsg.h index 3c1d89134c..bb93c52142 100644 --- a/src/inc/taosmsg.h +++ b/src/inc/taosmsg.h @@ -775,12 +775,7 @@ typedef struct { typedef struct { int32_t numOfVgroups; SVgroupMsg vgroups[]; -} SVgroupsInfo; - -typedef struct { - int32_t numOfVgroups; - SVgroupMsg vgroups[]; -} SVgroupsMsg; +} SVgroupsMsg, SVgroupsInfo; typedef struct STableMetaMsg { int32_t contLen;