未验证 提交 dbf84436 编写于 作者: S Shengliang Guan 提交者: GitHub

Merge pull request #20268 from taosdata/fix/fixDoubleFree

fix: avoid double free conn
......@@ -864,6 +864,8 @@ static void cliDestroyConn(SCliConn* conn, bool clear) {
QUEUE_REMOVE(&conn->q);
QUEUE_INIT(&conn->q);
conn->broken = true;
if (conn->list != NULL) {
SConnList* connList = conn->list;
connList->list->numOfConn--;
......@@ -1230,7 +1232,7 @@ static void cliSendBatchCb(uv_write_t* req, int status) {
} else {
tDebug("%s conn %p succ to send batch msg, batch size:%d, msgLen:%d", CONN_GET_INST_LABEL(conn), conn, p->wLen,
p->batchSize);
if (!uv_is_closing((uv_handle_t*)&conn->stream)) {
if (!uv_is_closing((uv_handle_t*)&conn->stream) && conn->broken == false) {
if (nxtBatch != NULL) {
conn->pBatch = nxtBatch;
cliSendBatch(conn);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册