提交 74d44497 编写于 作者: S siddontang

fix memory leak when read failed

Signed-off-by: Nsiddontang <siddontang@gmail.com>
上级 28b27619
......@@ -199,6 +199,7 @@ static void taosProcessTcpData(void *param) {
if (headLen != sizeof(STaosHeader)) {
tError("%s read error, headLen:%d", pThreadObj->label, headLen);
taosCleanUpFdObj(pFdObj);
free(buffer);
continue;
}
......@@ -214,6 +215,7 @@ static void taosProcessTcpData(void *param) {
if (leftLen != retLen) {
tError("%s read error, leftLen:%d retLen:%d", pThreadObj->label, leftLen, retLen);
taosCleanUpFdObj(pFdObj);
free(buffer);
continue;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册