diff options
Diffstat (limited to 'm_option.c')
-rw-r--r-- | m_option.c | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/m_option.c b/m_option.c index 4e8a776d26..b1b37ffc87 100644 --- a/m_option.c +++ b/m_option.c @@ -1677,8 +1677,6 @@ static int parse_obj_settings(const char* opt,char* str,const m_obj_list_t* list return 1; } -static void free_obj_settings_list(void* dst); - static int obj_settings_list_del(const char *opt_name,const char *param,void* dst, int src) { char** str_list = NULL; int r,i,idx_max = 0; @@ -1737,6 +1735,23 @@ static int obj_settings_list_del(const char *opt_name,const char *param,void* ds return 1; } +static void free_obj_settings_list(void* dst) { + int n; + m_obj_settings_t *d; + + if (!dst || !VAL(dst)) return; + + d = VAL(dst); +#ifndef NO_FREE + for (n = 0 ; d[n].name ; n++) { + free(d[n].name); + free_str_list(&(d[n].attribs)); + } + free(d); +#endif + VAL(dst) = NULL; +} + static int parse_obj_settings_list(const m_option_t* opt,const char *name, const char *param, void* dst, int src) { int n = 0,r,len = strlen(opt->name); @@ -1874,23 +1889,6 @@ static int parse_obj_settings_list(const m_option_t* opt,const char *name, return 1; } -static void free_obj_settings_list(void* dst) { - int n; - m_obj_settings_t *d; - - if(!dst || !VAL(dst)) return; - - d = VAL(dst); -#ifndef NO_FREE - for(n = 0 ; d[n].name ; n++) { - free(d[n].name); - free_str_list(&(d[n].attribs)); - } - free(d); -#endif - VAL(dst) = NULL; -} - static void copy_obj_settings_list(const m_option_t* opt,void* dst, const void* src) { m_obj_settings_t *d,*s; int n; |