Commit 8ae5bc4d authored by Max Kellermann's avatar Max Kellermann

update: fixed memory leak during container scan

The return value of map_directory_child_fs() must be freed.
parent d1ba27d8
...@@ -6,6 +6,7 @@ ver 0.15.5 (2009/??/??) ...@@ -6,6 +6,7 @@ ver 0.15.5 (2009/??/??)
- riff, aiff: fixed "limited range" gcc warning - riff, aiff: fixed "limited range" gcc warning
* decoder_thread: change the fallback decoder name to "mad" * decoder_thread: change the fallback decoder name to "mad"
* output_thread: check again if output is open on CANCEL * output_thread: check again if output is open on CANCEL
* update: fixed memory leak during container scan
ver 0.15.4 (2009/10/03) ver 0.15.4 (2009/10/03)
......
...@@ -459,17 +459,20 @@ update_container_file( struct directory* directory, ...@@ -459,17 +459,20 @@ update_container_file( struct directory* directory,
while ((vtrack = plugin->container_scan(pathname, ++tnum)) != NULL) while ((vtrack = plugin->container_scan(pathname, ++tnum)) != NULL)
{ {
struct song* song = song_file_new(vtrack, contdir); struct song* song = song_file_new(vtrack, contdir);
char *child_path_fs;
// shouldn't be necessary but it's there.. // shouldn't be necessary but it's there..
song->mtime = st->st_mtime; 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); songvec_add(&contdir->songs, song);
modified = true; modified = true;
g_free(vtrack);
} }
g_free(pathname); g_free(pathname);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment