提交 db8e9007 编写于 作者: D dapan1121

fix: fix memory leak issue

上级 06775965
...@@ -1489,9 +1489,14 @@ static bool rpcSendMsgToPeer(SRpcConn *pConn, void *msg, int msgLen) { ...@@ -1489,9 +1489,14 @@ static bool rpcSendMsgToPeer(SRpcConn *pConn, void *msg, int msgLen) {
} }
static void rpcProcessConnError(void *param, void *id) { static void rpcProcessConnError(void *param, void *id) {
if (NULL == param) {
return;
}
int64_t *rid = (int64_t*)param; int64_t *rid = (int64_t*)param;
SRpcReqContext *pContext = (SRpcReqContext *)taosAcquireRef(tsRpcRefId, *rid); SRpcReqContext *pContext = (SRpcReqContext *)taosAcquireRef(tsRpcRefId, *rid);
if (NULL == pContext) { if (NULL == pContext) {
free(param);
return; return;
} }
...@@ -1500,6 +1505,7 @@ static void rpcProcessConnError(void *param, void *id) { ...@@ -1500,6 +1505,7 @@ static void rpcProcessConnError(void *param, void *id) {
if (pRpc == NULL) { if (pRpc == NULL) {
taosReleaseRef(tsRpcRefId, *rid); taosReleaseRef(tsRpcRefId, *rid);
free(param);
return; return;
} }
...@@ -1521,6 +1527,7 @@ static void rpcProcessConnError(void *param, void *id) { ...@@ -1521,6 +1527,7 @@ static void rpcProcessConnError(void *param, void *id) {
} }
taosReleaseRef(tsRpcRefId, *rid); taosReleaseRef(tsRpcRefId, *rid);
free(param);
} }
static void rpcProcessRetryTimer(void *param, void *tmrId) { static void rpcProcessRetryTimer(void *param, void *tmrId) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册