From 091e7a625be0be880e789d712c9a05b4a800b125 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Tue, 17 May 2022 16:48:38 +0800 Subject: [PATCH] fix: some invalid read --- source/common/src/tdatablock.c | 1 + source/libs/qworker/src/qworker.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/source/common/src/tdatablock.c b/source/common/src/tdatablock.c index 43dcf2dfa9..dc4e6f7452 100644 --- a/source/common/src/tdatablock.c +++ b/source/common/src/tdatablock.c @@ -1135,6 +1135,7 @@ int32_t colInfoDataEnsureCapacity(SColumnInfoData* pColumn, size_t existRows, ui assert(pColumn->info.bytes); tmp = taosMemoryRealloc(pColumn->pData, numOfRows * pColumn->info.bytes); + memset(tmp, 0, numOfRows * pColumn->info.bytes); if (tmp == NULL) { return TSDB_CODE_OUT_OF_MEMORY; } diff --git a/source/libs/qworker/src/qworker.c b/source/libs/qworker/src/qworker.c index adf3588bd1..60ee375e2e 100644 --- a/source/libs/qworker/src/qworker.c +++ b/source/libs/qworker/src/qworker.c @@ -1311,6 +1311,7 @@ int32_t qwProcessHb(SQWorker *mgmt, SQWMsg *qwMsg, SSchedulerHbReq *req) { if (sch->hbConnInfo.handle) { tmsgReleaseHandle(&sch->hbConnInfo, TAOS_CONN_SERVER); + sch->hbConnInfo.handle = NULL; } memcpy(&sch->hbConnInfo, &qwMsg->connInfo, sizeof(qwMsg->connInfo)); @@ -1331,6 +1332,7 @@ _return: if (code) { tmsgReleaseHandle(&qwMsg->connInfo, TAOS_CONN_SERVER); + qwMsg->connInfo.handle = NULL; } QW_DLOG("hb rsp send, handle:%p, code:%x - %s", qwMsg->connInfo.handle, code, tstrerror(code)); -- GitLab