From 0b1cef9b51e8a07d7649dcef065ca67d1804300d Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Fri, 9 Dec 2022 11:29:04 +0800 Subject: [PATCH] fix udfd crash --- source/libs/transport/src/transCli.c | 1 + source/libs/transport/src/transComm.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/source/libs/transport/src/transCli.c b/source/libs/transport/src/transCli.c index 060d1d3a98..bc0486bd4c 100644 --- a/source/libs/transport/src/transCli.c +++ b/source/libs/transport/src/transCli.c @@ -285,6 +285,7 @@ static void cliReleaseUnfinishedMsg(SCliConn* conn) { } destroyCmsg(msg); } + memset(conn->ctx, 0, sizeof(conn->ctx)); } bool cliMaySendCachedMsg(SCliConn* conn) { if (!transQueueEmpty(&conn->cliMsgs)) { diff --git a/source/libs/transport/src/transComm.c b/source/libs/transport/src/transComm.c index ad8d57c97a..09f9a78ab8 100644 --- a/source/libs/transport/src/transComm.c +++ b/source/libs/transport/src/transComm.c @@ -282,6 +282,9 @@ void transCtxCleanup(STransCtx* ctx) { } void transCtxMerge(STransCtx* dst, STransCtx* src) { + if (src->args == NULL || src->freeFunc == NULL) { + return; + } if (dst->args == NULL) { dst->args = src->args; dst->brokenVal = src->brokenVal; -- GitLab