diff options
Diffstat (limited to 'm_config.c')
-rw-r--r-- | m_config.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/m_config.c b/m_config.c index 4d69869862..2223d0964e 100644 --- a/m_config.c +++ b/m_config.c @@ -32,7 +32,10 @@ m_config_free(m_config_t* config) { #endif while(i) { - sl = i->slots; + if (i->flags & M_CFG_OPT_ALIAS) + sl = NULL; + else + sl = i->slots; while(sl) { m_option_free(i->opt,sl->data); st = sl->prev; @@ -43,7 +46,7 @@ m_config_free(m_config_t* config) { free(i->name); ct = i->next; free(i); - ct = i; + i = ct; } free(config); } @@ -149,6 +152,7 @@ m_config_add_option(m_config_t *config, m_option_t *arg, char* prefix) { if(arg->type->flags & M_OPT_TYPE_HAS_CHILD) { m_option_t *ol = arg->p; int i; + co->slots = NULL; for(i = 0 ; ol[i].name != NULL ; i++) m_config_add_option(config,&ol[i], co->name); } else { @@ -174,6 +178,7 @@ m_config_add_option(m_config_t *config, m_option_t *arg, char* prefix) { m_option_set(arg,arg->p,sl->data); } sl->lvl = 0; + sl->prev = NULL; co->slots = (m_config_save_slot_t*)calloc(1,sizeof(m_config_save_slot_t) + arg->type->size); co->slots->prev = sl; co->slots->lvl = config->lvl; |