Merge pull request #20268 from taosdata/fix/fixDoubleFree
fix: avoid double free conn
This commit is contained in:
commit
dbf8443686
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue