fix: crash while get cfg item

This commit is contained in:
Shengliang Guan 2022-07-25 17:20:48 +08:00
parent 8651a5460a
commit e4c434d186
1 changed files with 1 additions and 0 deletions

View File

@ -335,6 +335,7 @@ int32_t cfgSetItem(SConfig *pCfg, const char *name, const char *value, ECfgSrcTy
}
SConfigItem *cfgGetItem(SConfig *pCfg, const char *name) {
if (pCfg == NULL) return NULL;
int32_t size = taosArrayGetSize(pCfg->array);
for (int32_t i = 0; i < size; ++i) {
SConfigItem *pItem = taosArrayGet(pCfg->array, i);