提交 8d56f7e1 编写于 作者: D dapan1121

fix mem free issue

上级 55ec2aa0
......@@ -327,31 +327,28 @@ int32_t ctgChkAuth(SCatalog* pCtg, void *pTrans, const SEpSet* pMgmtEps, const c
return TSDB_CODE_SUCCESS;
}
SGetUserAuthRsp* authRsp = taosMemoryCalloc(1, sizeof(SGetUserAuthRsp));
if (NULL == authRsp) {
CTG_ERR_RET(TSDB_CODE_OUT_OF_MEMORY);
}
CTG_ERR_RET(ctgGetUserDbAuthFromMnode(CTG_PARAMS_LIST(), user, authRsp, NULL));
SGetUserAuthRsp authRsp = {0};
CTG_ERR_RET(ctgGetUserDbAuthFromMnode(CTG_PARAMS_LIST(), user, &authRsp, NULL));
if (authRsp->superAuth) {
if (authRsp.superAuth) {
*pass = true;
goto _return;
}
if (authRsp->createdDbs && taosHashGet(authRsp->createdDbs, dbFName, strlen(dbFName))) {
if (authRsp.createdDbs && taosHashGet(authRsp.createdDbs, dbFName, strlen(dbFName))) {
*pass = true;
goto _return;
}
if (type == AUTH_TYPE_READ && authRsp->readDbs && taosHashGet(authRsp->readDbs, dbFName, strlen(dbFName))) {
if (type == AUTH_TYPE_READ && authRsp.readDbs && taosHashGet(authRsp.readDbs, dbFName, strlen(dbFName))) {
*pass = true;
} else if (type == AUTH_TYPE_WRITE && authRsp->writeDbs && taosHashGet(authRsp->writeDbs, dbFName, strlen(dbFName))) {
} else if (type == AUTH_TYPE_WRITE && authRsp.writeDbs && taosHashGet(authRsp.writeDbs, dbFName, strlen(dbFName))) {
*pass = true;
}
_return:
ctgPutUpdateUserToQueue(pCtg, authRsp, false);
ctgPutUpdateUserToQueue(pCtg, &authRsp, false);
return TSDB_CODE_SUCCESS;
}
......
......@@ -770,7 +770,7 @@ _return:
}
ctgPutUpdateUserToQueue(pCtg, pOut, false);
pTask->msgCtx.out = NULL;
taosMemoryFreeClear(pTask->msgCtx.out);
ctgHandleTaskEnd(pTask, code);
......
......@@ -715,8 +715,6 @@ int32_t ctgPutUpdateUserToQueue(SCatalog* pCtg, SGetUserAuthRsp *pAuth, bool syn
action.data = msg;
CTG_ERR_JRET(ctgPushAction(pCtg, &action));
taosMemoryFree(pAuth);
return TSDB_CODE_SUCCESS;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册