fix: heap user after free
This commit is contained in:
parent
ba48115231
commit
ff06f9ef42
|
@ -66,20 +66,12 @@ int32_t processConnectRsp(void* param, SDataBuf* pMsg, int32_t code) {
|
||||||
STscObj* pTscObj = pRequest->pTscObj;
|
STscObj* pTscObj = pRequest->pTscObj;
|
||||||
|
|
||||||
if (NULL == pTscObj->pAppInfo) {
|
if (NULL == pTscObj->pAppInfo) {
|
||||||
setErrno(pRequest, TSDB_CODE_TSC_DISCONNECTED);
|
code = TSDB_CODE_TSC_DISCONNECTED;
|
||||||
|
setErrno(pRequest, code);
|
||||||
tsem_post(&pRequest->body.rspSem);
|
tsem_post(&pRequest->body.rspSem);
|
||||||
goto End;
|
goto End;
|
||||||
}
|
}
|
||||||
|
|
||||||
taosThreadMutexLock(&clientHbMgr.lock);
|
|
||||||
if (NULL == taosArrayGetP(clientHbMgr.appHbMgrs, pTscObj->appHbMgrIdx)) {
|
|
||||||
taosThreadMutexUnlock(&clientHbMgr.lock);
|
|
||||||
setErrno(pRequest, TSDB_CODE_TSC_DISCONNECTED);
|
|
||||||
tsem_post(&pRequest->body.rspSem);
|
|
||||||
goto End;
|
|
||||||
}
|
|
||||||
taosThreadMutexUnlock(&clientHbMgr.lock);
|
|
||||||
|
|
||||||
SConnectRsp connectRsp = {0};
|
SConnectRsp connectRsp = {0};
|
||||||
if (tDeserializeSConnectRsp(pMsg->pData, pMsg->len, &connectRsp) != 0) {
|
if (tDeserializeSConnectRsp(pMsg->pData, pMsg->len, &connectRsp) != 0) {
|
||||||
code = TSDB_CODE_TSC_INVALID_VERSION;
|
code = TSDB_CODE_TSC_INVALID_VERSION;
|
||||||
|
@ -106,7 +98,8 @@ int32_t processConnectRsp(void* param, SDataBuf* pMsg, int32_t code) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (connectRsp.epSet.numOfEps == 0) {
|
if (connectRsp.epSet.numOfEps == 0) {
|
||||||
setErrno(pRequest, TSDB_CODE_APP_ERROR);
|
code = TSDB_CODE_APP_ERROR;
|
||||||
|
setErrno(pRequest, code);
|
||||||
tsem_post(&pRequest->body.rspSem);
|
tsem_post(&pRequest->body.rspSem);
|
||||||
goto End;
|
goto End;
|
||||||
}
|
}
|
||||||
|
@ -157,6 +150,12 @@ int32_t processConnectRsp(void* param, SDataBuf* pMsg, int32_t code) {
|
||||||
SAppHbMgr* pAppHbMgr = taosArrayGetP(clientHbMgr.appHbMgrs, pTscObj->appHbMgrIdx);
|
SAppHbMgr* pAppHbMgr = taosArrayGetP(clientHbMgr.appHbMgrs, pTscObj->appHbMgrIdx);
|
||||||
if (pAppHbMgr) {
|
if (pAppHbMgr) {
|
||||||
hbRegisterConn(pAppHbMgr, pTscObj->id, connectRsp.clusterId, connectRsp.connType);
|
hbRegisterConn(pAppHbMgr, pTscObj->id, connectRsp.clusterId, connectRsp.connType);
|
||||||
|
} else {
|
||||||
|
taosThreadMutexUnlock(&clientHbMgr.lock);
|
||||||
|
code = TSDB_CODE_TSC_DISCONNECTED;
|
||||||
|
setErrno(pRequest, code);
|
||||||
|
tsem_post(&pRequest->body.rspSem);
|
||||||
|
goto End;
|
||||||
}
|
}
|
||||||
taosThreadMutexUnlock(&clientHbMgr.lock);
|
taosThreadMutexUnlock(&clientHbMgr.lock);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue