diff options
-rw-r--r-- | music.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -105,18 +105,22 @@ struct file *music_find_file(const gchar *path) { gchar *filename = g_path_get_basename(path); struct directory *directory = music_find_dir(dirname); + g_free(dirname); if(directory == NULL) { + g_free(filename); return NULL; } for(GSList *node = directory->files; node; node = g_slist_next(node)) { struct file *f = node->data; if(g_strcmp0(filename, f->name) == 0) { + g_free(filename); return f; } } + g_free(filename); return NULL; } |