summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--music.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/music.c b/music.c
index c68504d..d3c9b64 100644
--- a/music.c
+++ b/music.c
@@ -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;
}