diff --git a/source/client/inc/clientInt.h b/source/client/inc/clientInt.h index 928afdaecf..30424adecd 100644 --- a/source/client/inc/clientInt.h +++ b/source/client/inc/clientInt.h @@ -373,6 +373,7 @@ int taos_options_imp(TSDB_OPTION option, const char* str); int32_t openTransporter(const char* user, const char* auth, int32_t numOfThreads, void **pDnodeConn); void tscStopCrashReport(); +void cleanupAppInfo(); typedef struct AsyncArg { SRpcMsg msg; diff --git a/source/client/src/clientEnv.c b/source/client/src/clientEnv.c index 2258a4bc8c..35e6651c41 100644 --- a/source/client/src/clientEnv.c +++ b/source/client/src/clientEnv.c @@ -688,7 +688,6 @@ void doDestroyRequest(void *p) { taosArrayDestroy(pRequest->tableList); taosArrayDestroy(pRequest->targetTableList); - destroyQueryExecRes(&pRequest->body.resInfo.execRes); if (pRequest->self) { @@ -702,12 +701,7 @@ void doDestroyRequest(void *p) { } taosMemoryFree(pRequest->body.interParam); - if (TSDB_CODE_SUCCESS == nodesSimAcquireAllocator(pRequest->allocatorRefId)) { - qDestroyQuery(pRequest->pQuery); - if (TSDB_CODE_SUCCESS != nodesSimReleaseAllocator(pRequest->allocatorRefId)) { - tscError("failed to release allocator"); - } - } + qDestroyQuery(pRequest->pQuery); nodesDestroyAllocator(pRequest->allocatorRefId); taosMemoryFreeClear(pRequest->effectiveUser); diff --git a/source/client/src/clientImpl.c b/source/client/src/clientImpl.c index 75c1eabe7e..4aa78caa15 100644 --- a/source/client/src/clientImpl.c +++ b/source/client/src/clientImpl.c @@ -68,6 +68,10 @@ bool chkRequestKilled(void* param) { return killed; } +void cleanupAppInfo() { + taosHashCleanup(appInfo.pInstMap); +} + static int32_t taosConnectImpl(const char* user, const char* auth, const char* db, __taos_async_fn_t fp, void* param, SAppInstInfo* pAppInfo, int connType, STscObj** pTscObj); diff --git a/source/client/src/clientMain.c b/source/client/src/clientMain.c index 0a5fb1a7b4..12702a93f3 100644 --- a/source/client/src/clientMain.c +++ b/source/client/src/clientMain.c @@ -67,7 +67,6 @@ void taos_cleanup(void) { fmFuncMgtDestroy(); qCleanupKeywordsTable(); - nodesDestroyAllocatorSet(); if (TSDB_CODE_SUCCESS != cleanupTaskQueue()) { tscWarn("failed to cleanup task queue"); @@ -85,6 +84,8 @@ void taos_cleanup(void) { tscWarn("failed to close clientReqRefPool"); } + nodesDestroyAllocatorSet(); + cleanupAppInfo(); rpcCleanup(); tscDebug("rpc cleanup"); diff --git a/tools/shell/src/shellEngine.c b/tools/shell/src/shellEngine.c index dbaf108e6a..0ccbd683dc 100644 --- a/tools/shell/src/shellEngine.c +++ b/tools/shell/src/shellEngine.c @@ -1170,6 +1170,7 @@ bool shellGetGrantInfo(char* buf) { code != TSDB_CODE_PAR_PERMISSION_DENIED) { fprintf(stderr, "Failed to check Server Edition, Reason:0x%04x:%s\r\n\r\n", code, taos_errstr(tres)); } + taos_free_result(tres); return community; }