diff options
author | Jon Bergli Heier <snakebite@jvnv.net> | 2010-08-18 00:24:31 +0200 |
---|---|---|
committer | Jon Bergli Heier <snakebite@jvnv.net> | 2010-08-18 00:24:31 +0200 |
commit | 4f153bf7b20a76da5563f86047a8c0e74436644d (patch) | |
tree | 98e8976bed615354fc462cd5f64c4cb397f6ac39 | |
parent | 4a964b563ca166002ba6cf5b4e20ab29cd8cfff3 (diff) |
Fixed memory leaks in music_find_file().
-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; } |