From df1947678fa2596e08c5d82c89b7f01e738010eb Mon Sep 17 00:00:00 2001 From: Yurun Date: Fri, 10 Dec 2021 15:55:48 +0800 Subject: [PATCH] Fix taos_cleanup() coredump when no taos_init() --- src/util/src/tlog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/src/tlog.c b/src/util/src/tlog.c index 232d10a7d0..e4a66d6bee 100644 --- a/src/util/src/tlog.c +++ b/src/util/src/tlog.c @@ -131,7 +131,7 @@ void taosCloseLog() { taosStopLog(); //tsem_post(&(tsLogObj.logHandle->buffNotEmpty)); taosMsleep(MAX_LOG_INTERVAL/1000); - if (taosCheckPthreadValid(tsLogObj.logHandle->asyncThread)) { + if (tsLogObj.logHandle && tsLogObj.logHandle->asyncThread && taosCheckPthreadValid(tsLogObj.logHandle->asyncThread)) { pthread_join(tsLogObj.logHandle->asyncThread, NULL); } // In case that other threads still use log resources causing invalid write in valgrind -- GitLab