enh: refactor return code
This commit is contained in:
parent
5f0c94ab4f
commit
901107df16
|
@ -3147,7 +3147,7 @@ int32_t mndValidateUserAuthInfo(SMnode *pMnode, SUserAuthVersion *pUsers, int32_
|
|||
if (TSDB_CODE_MND_USER_NOT_EXIST == code) {
|
||||
SGetUserAuthRsp rsp = {.dropped = 1};
|
||||
(void)memcpy(rsp.user, pUsers[i].user, TSDB_USER_LEN);
|
||||
(void)taosArrayPush(batchRsp.pArray, &rsp);
|
||||
TSDB_CHECK_NULL(taosArrayPush(batchRsp.pArray, &rsp), code, lino, _OVER, TSDB_CODE_OUT_OF_MEMORY);
|
||||
}
|
||||
mError("user:%s, failed to auth user since %s", pUsers[i].user, tstrerror(code));
|
||||
code = 0;
|
||||
|
@ -3168,7 +3168,12 @@ int32_t mndValidateUserAuthInfo(SMnode *pMnode, SUserAuthVersion *pUsers, int32_
|
|||
TAOS_CHECK_GOTO(code, &lino, _OVER);
|
||||
}
|
||||
|
||||
(void)taosArrayPush(batchRsp.pArray, &rsp);
|
||||
if (!(taosArrayPush(batchRsp.pArray, &rsp))) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
mndReleaseUser(pMnode, pUser);
|
||||
tFreeSGetUserAuthRsp(&rsp);
|
||||
TAOS_CHECK_GOTO(code, &lino, _OVER);
|
||||
}
|
||||
mndReleaseUser(pMnode, pUser);
|
||||
}
|
||||
|
||||
|
|
|
@ -213,7 +213,7 @@ static int32_t tdInitSmaStat(SSmaStat **pSmaStat, int8_t smaType, const SSma *pS
|
|||
TAOS_CHECK_GOTO(code, &lino, _exit);
|
||||
}
|
||||
SSDataBlock datablock = {.info.type = STREAM_CHECKPOINT};
|
||||
(void)taosArrayPush(pRSmaStat->blocks, &datablock);
|
||||
TSDB_CHECK_NULL(taosArrayPush(pRSmaStat->blocks, &datablock), code, lino, _exit, TSDB_CODE_OUT_OF_MEMORY);
|
||||
|
||||
// init smaMgmt
|
||||
TAOS_CHECK_GOTO(smaInit(), &lino, _exit);
|
||||
|
|
Loading…
Reference in New Issue