Commit 77e6810c authored by Max Kellermann's avatar Max Kellermann

decoder/mikmod: fix memory leak

The return value of Player_LoadTitle() is allocated with malloc(), and must be freed by the caller.
parent 5ebe3365
...@@ -3,6 +3,7 @@ ver 0.15.11 (2010/??/??) ...@@ -3,6 +3,7 @@ ver 0.15.11 (2010/??/??)
- ape: support album artist - ape: support album artist
* decoders: * decoders:
- mp4ff: support tags "albumartist", "band" - mp4ff: support tags "albumartist", "band"
- mikmod: fix memory leak
ver 0.15.10 (2010/05/30) ver 0.15.10 (2010/05/30)
......
...@@ -219,10 +219,12 @@ static struct tag *modTagDup(const char *file) ...@@ -219,10 +219,12 @@ static struct tag *modTagDup(const char *file)
ret->time = 0; ret->time = 0;
path2 = g_strdup(file); path2 = g_strdup(file);
title = g_strdup(Player_LoadTitle(path2)); title = Player_LoadTitle(path2);
g_free(path2); g_free(path2);
if (title) if (title) {
tag_add_item(ret, TAG_ITEM_TITLE, title); tag_add_item(ret, TAG_ITEM_TITLE, title);
free(title);
}
return ret; return ret;
} }
......
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