fix mem leak
This commit is contained in:
parent
3740bf6851
commit
7dc616194e
|
@ -825,18 +825,21 @@ static FORCE_INLINE void uvStartSendRespImpl(SSvrRespMsg* smsg) {
|
||||||
|
|
||||||
transRefSrvHandle(pConn);
|
transRefSrvHandle(pConn);
|
||||||
|
|
||||||
if (req == NULL) {
|
int32_t ret = uv_write(req, (uv_stream_t*)pConn->pTcp, pBuf, bufNum, uvOnSendCb);
|
||||||
if (!uv_is_closing((uv_handle_t*)(pConn->pTcp))) {
|
if (ret != 0) {
|
||||||
tError("conn %p failed to write data, reason:%s", pConn, tstrerror(TSDB_CODE_OUT_OF_MEMORY));
|
tError("conn %p failed to write data, reason:%s", pConn, tstrerror(TSDB_CODE_OUT_OF_MEMORY), uv_err_name(ret));
|
||||||
pConn->broken = true;
|
pConn->broken = true;
|
||||||
|
while (!QUEUE_IS_EMPTY(&pWreq->node)) {
|
||||||
|
queue* head = QUEUE_HEAD(&pWreq->node);
|
||||||
|
QUEUE_REMOVE(head);
|
||||||
|
SSvrRespMsg* smsg = QUEUE_DATA(head, SSvrRespMsg, q);
|
||||||
|
destroySmsg(smsg);
|
||||||
|
}
|
||||||
freeWReqToWQ(&pConn->wq, req->data);
|
freeWReqToWQ(&pConn->wq, req->data);
|
||||||
taosMemoryFree(pWreq);
|
|
||||||
transUnrefSrvHandle(pConn);
|
transUnrefSrvHandle(pConn);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
(void)uv_write(req, (uv_stream_t*)pConn->pTcp, pBuf, bufNum, uvOnSendCb);
|
|
||||||
}
|
|
||||||
int32_t uvMayHandleReleaseResp(SSvrRespMsg* pMsg) {
|
int32_t uvMayHandleReleaseResp(SSvrRespMsg* pMsg) {
|
||||||
SSvrConn* pConn = pMsg->pConn;
|
SSvrConn* pConn = pMsg->pConn;
|
||||||
int64_t qid = pMsg->msg.info.qId;
|
int64_t qid = pMsg->msg.info.qId;
|
||||||
|
|
Loading…
Reference in New Issue