diff --git a/source/libs/transport/src/transCli.c b/source/libs/transport/src/transCli.c index 3b8ea5858f..3a24d08a58 100644 --- a/source/libs/transport/src/transCli.c +++ b/source/libs/transport/src/transCli.c @@ -159,7 +159,7 @@ static void destroyThrdObj(SCliThrdObj* pThrd); int i = 0, sz = transQueueSize(&conn->cliMsgs); \ for (; i < sz; i++) { \ pMsg = transQueueGet(&conn->cliMsgs, i); \ - if (pMsg != NULL && (uint64_t)pMsg->ctx->ahandle == ahandle) { \ + if (pMsg != NULL && pMsg->ctx != NULL && (uint64_t)pMsg->ctx->ahandle == ahandle) { \ break; \ } \ } \ diff --git a/source/libs/transport/src/transSrv.c b/source/libs/transport/src/transSrv.c index 787c538f2a..3950a42ef0 100644 --- a/source/libs/transport/src/transSrv.c +++ b/source/libs/transport/src/transSrv.c @@ -292,7 +292,7 @@ void uvOnSendCb(uv_write_t* req, int status) { } transQueuePop(&conn->srvMsgs); tfree(msg); - msg = (SSrvMsg*)transQueuePop(&conn->srvMsgs); + msg = (SSrvMsg*)transQueueGet(&conn->srvMsgs, 0); if (msg != NULL) { uvStartSendRespInternal(msg); }