Fix mem error at mndConfig.c.

This commit is contained in:
xiao-77 2024-12-05 10:58:56 +08:00
parent cb50b1e52c
commit cf5960d847
1 changed files with 1 additions and 3 deletions

View File

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