From de8f2739c2977ffb042bfd9c36630fe6f187901f Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 31 May 2010 10:24:08 +0200 Subject: decoder/mikmod: fix memory leak The return value of Player_LoadTitle() is allocated with malloc(), and must be freed by the caller. --- src/decoder/mikmod_decoder_plugin.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/decoder') diff --git a/src/decoder/mikmod_decoder_plugin.c b/src/decoder/mikmod_decoder_plugin.c index 5cbfa23dd..50b46f2af 100644 --- a/src/decoder/mikmod_decoder_plugin.c +++ b/src/decoder/mikmod_decoder_plugin.c @@ -195,11 +195,13 @@ mikmod_decoder_tag_dup(const char *path_fs) tag->time = 0; - char *title = g_strdup(Player_LoadTitle(path2)); + char *title = Player_LoadTitle(path2); g_free(path2); - if (title) + if (title != NULL) { tag_add_item(tag, TAG_TITLE, title); + free(title); + } return tag; } -- cgit v1.2.3