From cf5960d847190ddc6b8328c2b5b9cd09a77d5044 Mon Sep 17 00:00:00 2001 From: xiao-77 Date: Thu, 5 Dec 2024 10:58:56 +0800 Subject: [PATCH] Fix mem error at mndConfig.c. --- source/dnode/mnode/impl/src/mndConfig.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/source/dnode/mnode/impl/src/mndConfig.c b/source/dnode/mnode/impl/src/mndConfig.c index f7065ddf09..d400f32d25 100644 --- a/source/dnode/mnode/impl/src/mndConfig.c +++ b/source/dnode/mnode/impl/src/mndConfig.c @@ -386,9 +386,7 @@ int32_t cfgUpdateItem(SConfigItem *pItem, SConfigObj *obj) { case CFG_DTYPE_STRING: { if (obj->str != NULL) { taosMemoryFree(pItem->str); - pItem->str = taosMemoryMalloc(strlen(obj->str) + 1); - tstrncpy(pItem->str, obj->str, strlen(obj->str)); - pItem->str[strlen(obj->str)] = 0; + pItem->str = taosStrdup(obj->str); } break; }