fix invalid read
This commit is contained in:
parent
0c8e9046f6
commit
66cb3e1576
|
@ -348,6 +348,7 @@ bool cliConnSendSeqMsg(int64_t refId, SCliConn* conn) {
|
||||||
taosWLockLatch(&exh->latch);
|
taosWLockLatch(&exh->latch);
|
||||||
if (exh->handle == NULL) exh->handle = conn;
|
if (exh->handle == NULL) exh->handle = conn;
|
||||||
exh->inited = 1;
|
exh->inited = 1;
|
||||||
|
exh->pThrd = conn->hostThrd;
|
||||||
if (!QUEUE_IS_EMPTY(&exh->q)) {
|
if (!QUEUE_IS_EMPTY(&exh->q)) {
|
||||||
queue* h = QUEUE_HEAD(&exh->q);
|
queue* h = QUEUE_HEAD(&exh->q);
|
||||||
QUEUE_REMOVE(h);
|
QUEUE_REMOVE(h);
|
||||||
|
@ -2514,7 +2515,7 @@ static FORCE_INLINE SCliThrd* transGetWorkThrdFromHandle(STrans* trans, int64_t
|
||||||
if (exh == NULL) {
|
if (exh == NULL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
taosWLockLatch(&exh->latch);
|
||||||
if (exh->pThrd == NULL && trans != NULL) {
|
if (exh->pThrd == NULL && trans != NULL) {
|
||||||
int idx = cliRBChoseIdx(trans);
|
int idx = cliRBChoseIdx(trans);
|
||||||
if (idx < 0) return NULL;
|
if (idx < 0) return NULL;
|
||||||
|
@ -2522,7 +2523,9 @@ static FORCE_INLINE SCliThrd* transGetWorkThrdFromHandle(STrans* trans, int64_t
|
||||||
}
|
}
|
||||||
|
|
||||||
pThrd = exh->pThrd;
|
pThrd = exh->pThrd;
|
||||||
|
taosWUnLockLatch(&exh->latch);
|
||||||
transReleaseExHandle(transGetRefMgt(), handle);
|
transReleaseExHandle(transGetRefMgt(), handle);
|
||||||
|
|
||||||
return pThrd;
|
return pThrd;
|
||||||
}
|
}
|
||||||
SCliThrd* transGetWorkThrd(STrans* trans, int64_t handle) {
|
SCliThrd* transGetWorkThrd(STrans* trans, int64_t handle) {
|
||||||
|
|
Loading…
Reference in New Issue