From b2f306e09d94d102740da63d6575420590944831 Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Thu, 29 Dec 2022 14:12:09 +0800 Subject: [PATCH] avoid invalid free --- source/dnode/mgmt/exe/dmMain.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/source/dnode/mgmt/exe/dmMain.c b/source/dnode/mgmt/exe/dmMain.c index a432201413..d308d3e618 100644 --- a/source/dnode/mgmt/exe/dmMain.c +++ b/source/dnode/mgmt/exe/dmMain.c @@ -178,7 +178,7 @@ static int32_t dmInitLog() { } static void taosCleanupArgs() { - if (global.envCmd != NULL) taosMemoryFree(global.envCmd); + if (global.envCmd != NULL) taosMemoryFreeClear(global.envCmd); } int main(int argc, char const *argv[]) { @@ -271,7 +271,6 @@ int mainWindows(int argc, char **argv) { taosCleanupCfg(); taosCloseLog(); - taosCleanupArgs(); taosConvDestroy(); return -1; }