diff options
Diffstat (limited to 'package/config/util.c')
-rw-r--r-- | package/config/util.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/package/config/util.c b/package/config/util.c index b15dbab33..5fc36c7d2 100644 --- a/package/config/util.c +++ b/package/config/util.c @@ -12,15 +12,18 @@ struct file *file_lookup(const char *name) { struct file *file; + const char *file_name = sym_expand_string_value(name); for (file = file_list; file; file = file->next) { - if (!strcmp(name, file->name)) + if (!strcmp(name, file->name)) { + free((void *)file_name); return file; + } } file = malloc(sizeof(*file)); memset(file, 0, sizeof(*file)); - file->name = strdup(name); + file->name = file_name; file->next = file_list; file_list = file; return file; |