From 5fccaf62b5d4249ccf0a884bdf0dd76ea0909ecc Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Wed, 15 Nov 2023 10:04:29 +0800 Subject: [PATCH] fix mem leak --- source/libs/transport/src/transSvr.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source/libs/transport/src/transSvr.c b/source/libs/transport/src/transSvr.c index bf73c253bc..79665795df 100644 --- a/source/libs/transport/src/transSvr.c +++ b/source/libs/transport/src/transSvr.c @@ -159,7 +159,7 @@ static void uvStartSendResp(SSvrMsg* msg); static void uvNotifyLinkBrokenToApp(SSvrConn* conn); -static FORCE_INLINE void destroySmsg(SSvrMsg* smsg); +static FORCE_INLINE void destroySmsg(SSvrMsg* smsg); static FORCE_INLINE SSvrConn* createConn(void* hThrd); static FORCE_INLINE void destroyConn(SSvrConn* conn, bool clear /*clear handle or not*/); static FORCE_INLINE void destroyConnRegArg(SSvrConn* conn); @@ -1498,8 +1498,11 @@ int transSendResponse(const STransMsg* msg) { return 0; } SExHandle* exh = msg->info.handle; + if (exh == NULL) { - return 0; + rpcFreeCont(msg->pCont); + tTrace("msg handle already released"); + return -1; } int64_t refId = msg->info.refId; ASYNC_CHECK_HANDLE(exh, refId);