From e3a6b92f4eaf69e848403261024339e212942ac4 Mon Sep 17 00:00:00 2001 From: shenglian zhou Date: Tue, 12 Sep 2023 15:00:08 +0800 Subject: [PATCH] fix: fix minior bugs --- source/client/src/clientMain.c | 7 +++++-- source/common/src/tmsg.c | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/source/client/src/clientMain.c b/source/client/src/clientMain.c index 9db1c72e04..1afbc65db0 100644 --- a/source/client/src/clientMain.c +++ b/source/client/src/clientMain.c @@ -175,12 +175,15 @@ int32_t fetchWhiteListCallbackFn(void* param, SDataBuf* pMsg, int32_t code) { return code; } - SGetUserWhiteListRsp *pRsp = pMsg->pData; - pInfo->userCbFn(pInfo->userParam, code, taos, pRsp->numWhiteLists, &pRsp->pWhiteLists->ip_mask); + SGetUserWhiteListRsp wlRsp; + tDeserializeSGetUserWhiteListRsp(pMsg->pData, pMsg->len, &wlRsp); + + pInfo->userCbFn(pInfo->userParam, code, taos, wlRsp.numWhiteLists, &wlRsp.pWhiteLists->ip_mask); taosMemoryFree(pMsg->pData); taosMemoryFree(pMsg->pEpSet); taosMemoryFree(pInfo); + tFreeSGetUserWhiteListRsp(&wlRsp); return code; } diff --git a/source/common/src/tmsg.c b/source/common/src/tmsg.c index e47a9cbfcb..2285d0df23 100644 --- a/source/common/src/tmsg.c +++ b/source/common/src/tmsg.c @@ -1906,7 +1906,7 @@ void tFreeSGetUserAuthRsp(SGetUserAuthRsp *pRsp) { taosHashCleanup(pRsp->useDbs); } -int32_t tSerializeSGetWhiteListReq(void *buf, int32_t bufLen, SGetUserWhiteListReq *pReq) { +int32_t tSerializeSGetUserWhiteListReq(void *buf, int32_t bufLen, SGetUserWhiteListReq *pReq) { SEncoder encoder = {0}; tEncoderInit(&encoder, buf, bufLen);