From 21792262f5bbcf14d5f3188c85e194a79a2243ab Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Tue, 29 Sep 2020 01:23:14 +0000 Subject: [PATCH] TD-1617 --- src/sync/src/syncMain.c | 4 ++-- src/sync/test/syncServer.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sync/src/syncMain.c b/src/sync/src/syncMain.c index c7b8959926..0daf0b9620 100644 --- a/src/sync/src/syncMain.c +++ b/src/sync/src/syncMain.c @@ -491,7 +491,7 @@ static SSyncPeer *syncAddPeer(SSyncNode *pNode, const SNodeInfo *pInfo) { uint32_t ip = taosGetIpFromFqdn(pInfo->nodeFqdn); if (ip == -1) return NULL; - SSyncPeer *pPeer = (SSyncPeer *)calloc(1, sizeof(SSyncPeer)); + SSyncPeer *pPeer = calloc(1, sizeof(SSyncPeer)); if (pPeer == NULL) return NULL; pPeer->nodeId = pInfo->nodeId; @@ -499,7 +499,7 @@ static SSyncPeer *syncAddPeer(SSyncNode *pNode, const SNodeInfo *pInfo) { pPeer->ip = ip; pPeer->port = pInfo->nodePort; pPeer->fqdn[sizeof(pPeer->fqdn) - 1] = 0; - snprintf(pPeer->id, sizeof(pPeer->id), "vgId:%d peer:%s:%d", pNode->vgId, pPeer->fqdn, pPeer->port); + snprintf(pPeer->id, sizeof(pPeer->id), "vgId:%d peer:%s:%u", pNode->vgId, pPeer->fqdn, pPeer->port); pPeer->peerFd = -1; pPeer->syncFd = -1; diff --git a/src/sync/test/syncServer.c b/src/sync/test/syncServer.c index aa07779845..380b971fa8 100644 --- a/src/sync/test/syncServer.c +++ b/src/sync/test/syncServer.c @@ -109,7 +109,6 @@ int processRpcMsg(void *item) { if (pCfg->quorum <= 1) { rpcFreeCont(pMsg->pCont); - taosFreeQitem(item); SRpcMsg rpcMsg = {0}; rpcMsg.pCont = rpcMallocCont(msgSize); @@ -117,6 +116,7 @@ int processRpcMsg(void *item) { rpcMsg.handle = pMsg->handle; rpcMsg.code = code; rpcSendResponse(&rpcMsg); + taosFreeQitem(item); } return code; -- GitLab