fix: fix minior bugs

This commit is contained in:
shenglian zhou 2023-09-12 15:00:08 +08:00
parent d5f1662bf5
commit e3a6b92f4e
2 changed files with 6 additions and 3 deletions

View File

@ -175,12 +175,15 @@ int32_t fetchWhiteListCallbackFn(void* param, SDataBuf* pMsg, int32_t code) {
return code; return code;
} }
SGetUserWhiteListRsp *pRsp = pMsg->pData; SGetUserWhiteListRsp wlRsp;
pInfo->userCbFn(pInfo->userParam, code, taos, pRsp->numWhiteLists, &pRsp->pWhiteLists->ip_mask); tDeserializeSGetUserWhiteListRsp(pMsg->pData, pMsg->len, &wlRsp);
pInfo->userCbFn(pInfo->userParam, code, taos, wlRsp.numWhiteLists, &wlRsp.pWhiteLists->ip_mask);
taosMemoryFree(pMsg->pData); taosMemoryFree(pMsg->pData);
taosMemoryFree(pMsg->pEpSet); taosMemoryFree(pMsg->pEpSet);
taosMemoryFree(pInfo); taosMemoryFree(pInfo);
tFreeSGetUserWhiteListRsp(&wlRsp);
return code; return code;
} }

View File

@ -1906,7 +1906,7 @@ void tFreeSGetUserAuthRsp(SGetUserAuthRsp *pRsp) {
taosHashCleanup(pRsp->useDbs); 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}; SEncoder encoder = {0};
tEncoderInit(&encoder, buf, bufLen); tEncoderInit(&encoder, buf, bufLen);