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); }