diff --git a/source/libs/transport/src/transCli.c b/source/libs/transport/src/transCli.c index aab23ec8a0..8aea8b7aaa 100644 --- a/source/libs/transport/src/transCli.c +++ b/source/libs/transport/src/transCli.c @@ -907,7 +907,6 @@ static int32_t specifyConnRef(SCliConn* conn, bool update, int64_t handle) { taosWUnLockLatch(&exh->latch); conn->refId = exh->refId; - taosWUnLockLatch(&exh->latch); tDebug("conn %p specified by %" PRId64 "", conn, handle); @@ -1978,6 +1977,7 @@ static void cliBatchDealReq(queue* wq, SCliThrd* pThrd) { continue; } QUEUE_INIT(&pBatchList->wq); + pBatchList->port = port; pBatchList->connMax = pInst->connLimitNum; pBatchList->connCnt = 0; pBatchList->batchLenLimit = pInst->batchSize; @@ -1993,7 +1993,6 @@ static void cliBatchDealReq(queue* wq, SCliThrd* pThrd) { tError("failed to create batch list, reason:%s", tstrerror(TSDB_CODE_OUT_OF_MEMORY)); continue; } - pBatchList->port = port; SCliBatch* pBatch = taosMemoryCalloc(1, sizeof(SCliBatch)); if (pBatch == NULL) { diff --git a/source/libs/transport/src/transComm.c b/source/libs/transport/src/transComm.c index 69faf5a266..b940c494d8 100644 --- a/source/libs/transport/src/transComm.c +++ b/source/libs/transport/src/transComm.c @@ -441,15 +441,12 @@ void transReqQueueClear(queue* q) { } int32_t transQueueInit(STransQueue* queue, void (*freeFunc)(const void* arg)) { - queue->q = taosArrayInit(4, sizeof(void*)); - if (taosArrayReserve(queue->q, 4) == NULL) { + queue->q = taosArrayInit(2, sizeof(void*)); + if (queue->q == NULL) { return TSDB_CODE_OUT_OF_MEMORY; } queue->freeFunc = (void (*)(const void*))freeFunc; - if (queue->q == NULL) { - return TSDB_CODE_OUT_OF_MEMORY; - } return 0; } bool transQueuePush(STransQueue* queue, void* arg) { diff --git a/source/libs/transport/src/transSvr.c b/source/libs/transport/src/transSvr.c index f3e4c93f1b..c1b934c812 100644 --- a/source/libs/transport/src/transSvr.c +++ b/source/libs/transport/src/transSvr.c @@ -541,7 +541,7 @@ void uvOnRecvCb(uv_stream_t* cli, ssize_t nread, const uv_buf_t* buf) { void uvAllocConnBufferCb(uv_handle_t* handle, size_t suggested_size, uv_buf_t* buf) { buf->len = 2; buf->base = taosMemoryCalloc(1, sizeof(char) * buf->len); - if (buf == NULL) { + if (buf->base == NULL) { tError("failed to alloc conn read buffer since %s", tstrerror(TSDB_CODE_OUT_OF_MEMORY)); } }