--- libaitcfg/src/aitcfg.c 2019/12/05 14:33:35 1.14 +++ libaitcfg/src/aitcfg.c 2021/11/26 01:15:03 1.15 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: aitcfg.c,v 1.14 2019/12/05 14:33:35 misho Exp $ +* $Id: aitcfg.c,v 1.15 2021/11/26 01:15:03 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -12,7 +12,7 @@ terms: All of the documentation and software included in the ELWIX and AITNET Releases is copyrighted by ELWIX - Sofia/Bulgaria -Copyright 2004 - 2019 +Copyright 2004 - 2021 by Michael Pounov . All rights reserved. Redistribution and use in source and binary forms, with or without @@ -173,6 +173,8 @@ cfgLoadConfig(const char *cfgName, cfg_root_t * __rest cfg_SetErr(EINVAL, "Invalid parameter(s)"); return -1; } else { + memset(cfg, 0, sizeof(cfg_root_t)); + pthread_mutex_init(&cfg->rc_mtx, NULL); TAILQ_INIT(cfg); @@ -321,6 +323,8 @@ cfgLoadPasswd(const char *pwdName, pwd_root_t * __rest cfg_SetErr(EINVAL, "Invalid parameter(s)"); return -1; } else { + memset(pwd, 0, sizeof(pwd_root_t)); + pthread_mutex_init(&pwd->pwd_mtx, NULL); SLIST_INIT(pwd);