fix: crash while set rpcinfo for db trans

This commit is contained in:
Shengliang Guan 2022-07-19 20:06:03 +08:00
parent 68dd74bcb3
commit 2c619652aa
1 changed files with 6 additions and 2 deletions

View File

@ -708,9 +708,13 @@ int32_t mndSetRpcInfoForDbTrans(SMnode *pMnode, SRpcMsg *pMsg, EOperType oper, c
if (pTrans->oper == oper) {
if (strcasecmp(dbname, pTrans->dbname1) == 0) {
mDebug("trans:%d, db:%s oper:%d matched with input", pTrans->id, dbname, oper);
if (taosArrayPush(pTrans->pRpcArray, &pMsg->info) != NULL) {
code = 0;
if (pTrans->pRpcArray == NULL) {
pTrans->pRpcArray = taosArrayInit(1, sizeof(SRpcHandleInfo));
if (pTrans->pRpcArray != NULL && taosArrayPush(pTrans->pRpcArray, &pMsg->info) != NULL) {
code = 0;
}
}
sdbRelease(pMnode->pSdb, pTrans);
break;
}