--- libaitcfg/src/queue.c 2012/04/02 16:11:13 1.6.4.5 +++ libaitcfg/src/queue.c 2012/05/23 14:52:50 1.7.2.3 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: queue.c,v 1.6.4.5 2012/04/02 16:11:13 misho Exp $ +* $Id: queue.c,v 1.7.2.3 2012/05/23 14:52:50 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -69,14 +69,6 @@ _selectAttribute(cfg_root_t * __restrict cfg, const ch return RB_FIND(tagRC, cfg, &fav); } -static inline void -_destroyAttribute(struct tagCfg *av) -{ - if (!av) - return; - -} - /* --------------------------------------------------------------- */ /* @@ -143,7 +135,7 @@ cfg_unsetAttribute(cfg_root_t * __restrict cfg, const AIT_FREE_VAL(&av->cfg_val); AIT_FREE_VAL(&av->cfg_attr); AIT_FREE_VAL(&av->cfg_sec); - free(av); + io_free(av); return 1; } @@ -169,7 +161,7 @@ cfg_setAttribute(cfg_root_t * __restrict cfg, const ch /* adding new element */ section = _selectAttribute(cfg, csSec, NULL); - av = malloc(sizeof(struct tagCfg)); + av = io_malloc(sizeof(struct tagCfg)); if (!av) { LOGERR; return -1; @@ -262,7 +254,8 @@ cfg_loadAttribute(cfg_root_t * __restrict cfg, const c if (csDefValue) { AIT_SET_STR(val, csDefValue); ret = AIT_LEN(val); - } + } else + AIT_INIT_VAL(val); return ret; } @@ -271,7 +264,8 @@ cfg_loadAttribute(cfg_root_t * __restrict cfg, const c if (csDefValue) { AIT_SET_STR(val, csDefValue); ret = AIT_LEN(val); - } + } else + AIT_INIT_VAL(val); } else { /* copy value */ AIT_SET_STR(val, AIT_GET_STR(&av->cfg_val));