From bdfb342ec893898c6d9d9896e0fab65fac29c0eb Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Fri, 17 Feb 2023 14:44:00 +0800 Subject: [PATCH] fix: free thread save memory before set null --- tools/shell/src/shellAuto.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/shell/src/shellAuto.c b/tools/shell/src/shellAuto.c index 3589558d64..480421b5c0 100644 --- a/tools/shell/src/shellAuto.c +++ b/tools/shell/src/shellAuto.c @@ -788,6 +788,9 @@ int writeVarNames(int type, TAOS_RES* tres) { void setThreadNull(int type) { taosThreadMutexLock(&tiresMutex); + if(threads[type]) { + taosMemoryFree(threads[type]); + } threads[type] = NULL; taosThreadMutexUnlock(&tiresMutex); }