From 6b3d0a18385bc024d8324bf93fbb960c1d0e8f5a Mon Sep 17 00:00:00 2001 From: Jeff Tao Date: Mon, 6 Jul 2020 23:31:07 +0000 Subject: [PATCH] free pReqMsg if outType is not 0 --- src/rpc/src/rpcMain.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/rpc/src/rpcMain.c b/src/rpc/src/rpcMain.c index d14a98ab30..e432e47e36 100644 --- a/src/rpc/src/rpcMain.c +++ b/src/rpc/src/rpcMain.c @@ -603,7 +603,10 @@ static void rpcReleaseConn(SRpcConn *pConn) { rpcFreeMsg(pConn->pRspMsg); // it may have a response msg saved, but not request msg pConn->pRspMsg = NULL; if (pConn->pReqMsg) rpcFreeCont(pConn->pReqMsg); - } + } else { + if (pConn->outType && pConn->pReqMsg) + rpcFreeCont(pConn->pReqMsg); + } // memset could not be used, since lockeBy can not be reset pConn->inType = 0;