fix memory leak when read failed
Signed-off-by: siddontang <siddontang@gmail.com>
This commit is contained in:
parent
28b27619c9
commit
74d44497d8
|
@ -199,6 +199,7 @@ static void taosProcessTcpData(void *param) {
|
||||||
if (headLen != sizeof(STaosHeader)) {
|
if (headLen != sizeof(STaosHeader)) {
|
||||||
tError("%s read error, headLen:%d", pThreadObj->label, headLen);
|
tError("%s read error, headLen:%d", pThreadObj->label, headLen);
|
||||||
taosCleanUpFdObj(pFdObj);
|
taosCleanUpFdObj(pFdObj);
|
||||||
|
free(buffer);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -214,6 +215,7 @@ static void taosProcessTcpData(void *param) {
|
||||||
if (leftLen != retLen) {
|
if (leftLen != retLen) {
|
||||||
tError("%s read error, leftLen:%d retLen:%d", pThreadObj->label, leftLen, retLen);
|
tError("%s read error, leftLen:%d retLen:%d", pThreadObj->label, leftLen, retLen);
|
||||||
taosCleanUpFdObj(pFdObj);
|
taosCleanUpFdObj(pFdObj);
|
||||||
|
free(buffer);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue