From 77e6810c14e3b47f27a385e2fd9e8760710d0a99 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 30 Jun 2010 19:37:36 +0000 Subject: [PATCH] decoder/mikmod: fix memory leak The return value of Player_LoadTitle() is allocated with malloc(), and must be freed by the caller. --- NEWS | 1 + src/decoder/mikmod_plugin.c | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 6f499856d..eaaa24b9f 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,7 @@ ver 0.15.11 (2010/??/??) - ape: support album artist * decoders: - mp4ff: support tags "albumartist", "band" + - mikmod: fix memory leak ver 0.15.10 (2010/05/30) 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; }