summaryrefslogtreecommitdiffstats
path: root/m_config.c
diff options
context:
space:
mode:
Diffstat (limited to 'm_config.c')
-rw-r--r--m_config.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/m_config.c b/m_config.c
index fcf86e785f..47e893717c 100644
--- a/m_config.c
+++ b/m_config.c
@@ -216,6 +216,11 @@ void m_config_free(struct m_config *config)
for (copt = config->opts; copt; copt = copt->next) {
if (copt->flags & M_CFG_OPT_ALIAS)
continue;
+ if (copt->opt->type->flags & M_OPT_TYPE_DYNAMIC) {
+ void *ptr = m_option_get_ptr(copt->opt, config->optstruct);
+ if (ptr)
+ m_option_free(copt->opt, ptr);
+ }
struct m_config_save_slot *sl;
for (sl = copt->slots; sl; sl = sl->prev)
m_option_free(copt->opt, sl->data);