aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-10-16 17:38:15 +0200
committerMax Kellermann <max@duempel.org>2009-10-16 17:38:15 +0200
commit8ae5bc4d790d026a25049dd213814429ff8c8b2b (patch)
treec20be1f33b854ce31cd47a4adf39a231573f3fb5
parentd1ba27d820dc96c41cc3814801c12392060692dc (diff)
downloadmpd-8ae5bc4d790d026a25049dd213814429ff8c8b2b.tar.gz
mpd-8ae5bc4d790d026a25049dd213814429ff8c8b2b.tar.xz
mpd-8ae5bc4d790d026a25049dd213814429ff8c8b2b.zip
update: fixed memory leak during container scan
The return value of map_directory_child_fs() must be freed.
-rw-r--r--NEWS1
-rw-r--r--src/update.c9
2 files changed, 7 insertions, 3 deletions
diff --git a/NEWS b/NEWS
index af70f783b..54e0e8cc9 100644
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,7 @@ ver 0.15.5 (2009/??/??)
- riff, aiff: fixed "limited range" gcc warning
* decoder_thread: change the fallback decoder name to "mad"
* output_thread: check again if output is open on CANCEL
+* update: fixed memory leak during container scan
ver 0.15.4 (2009/10/03)
diff --git a/src/update.c b/src/update.c
index 4aa48f25c..24960b449 100644
--- a/src/update.c
+++ b/src/update.c
@@ -459,17 +459,20 @@ update_container_file( struct directory* directory,
while ((vtrack = plugin->container_scan(pathname, ++tnum)) != NULL)
{
struct song* song = song_file_new(vtrack, contdir);
+ char *child_path_fs;
// shouldn't be necessary but it's there..
song->mtime = st->st_mtime;
- song->tag = plugin->tag_dup(map_directory_child_fs(contdir, vtrack));
+ child_path_fs = map_directory_child_fs(contdir, vtrack);
+ g_free(vtrack);
+
+ song->tag = plugin->tag_dup(child_path_fs);
+ g_free(child_path_fs);
songvec_add(&contdir->songs, song);
modified = true;
-
- g_free(vtrack);
}
g_free(pathname);