decoder/mikmod: fix memory leak

The return value of Player_LoadTitle() is allocated with malloc(), and
must be freed by the caller.
This commit is contained in:
Max Kellermann
2010-06-30 19:37:36 +00:00
parent 5ebe33653c
commit 77e6810c14
2 changed files with 5 additions and 2 deletions

View File

@@ -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;
}