Skip to content

Commit

Permalink
fix memory leak when read failed
Browse files Browse the repository at this point in the history
Signed-off-by: siddontang <[email protected]>
  • Loading branch information
siddontang committed Jul 12, 2019
1 parent 28b2761 commit 74d4449
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/rpc/src/ttcpserver.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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;
}

Expand Down

0 comments on commit 74d4449

Please sign in to comment.