aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2010-06-30 19:37:36 +0000
committerMax Kellermann <max@duempel.org>2010-06-30 19:37:36 +0000
commit77e6810c14e3b47f27a385e2fd9e8760710d0a99 (patch)
tree0a79d082dc5df1466b0132ed96fb809dddcf663c /src/decoder
parent5ebe33653c162a3a07a9a1fd71201e22fa152c6c (diff)
downloadmpd-77e6810c14e3b47f27a385e2fd9e8760710d0a99.tar.gz
mpd-77e6810c14e3b47f27a385e2fd9e8760710d0a99.tar.xz
mpd-77e6810c14e3b47f27a385e2fd9e8760710d0a99.zip
decoder/mikmod: fix memory leak
The return value of Player_LoadTitle() is allocated with malloc(), and must be freed by the caller.
Diffstat (limited to '')
-rw-r--r--src/decoder/mikmod_plugin.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/decoder/mikmod_plugin.c b/src/decoder/mikmod_plugin.c
index 065c34319..f60dcbc61 100644
--- a/src/decoder/mikmod_plugin.c
+++ b/src/decoder/mikmod_plugin.c
@@ -219,10 +219,12 @@ static struct tag *modTagDup(const char *file)
ret->time = 0;
path2 = g_strdup(file);
- title = g_strdup(Player_LoadTitle(path2));
+ title = Player_LoadTitle(path2);
g_free(path2);
- if (title)
+ if (title) {
tag_add_item(ret, TAG_ITEM_TITLE, title);
+ free(title);
+ }
return ret;
}