From e271f69a3469d91397714f14614bdf5796458dd1 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 31 May 2010 10:16:09 +0200 Subject: decoder/mikdmod: moved local variable declarations in tag_dup() --- src/decoder/mikmod_decoder_plugin.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'src/decoder/mikmod_decoder_plugin.c') diff --git a/src/decoder/mikmod_decoder_plugin.c b/src/decoder/mikmod_decoder_plugin.c index 69212da59..c3d2ae4b0 100644 --- a/src/decoder/mikmod_decoder_plugin.c +++ b/src/decoder/mikmod_decoder_plugin.c @@ -179,13 +179,8 @@ mikmod_decoder_file_decode(struct decoder *decoder, const char *path_fs) static struct tag * mikmod_decoder_tag_dup(const char *path_fs) { - char *path2; - struct tag *ret = NULL; - MODULE *handle; - char *title; - - path2 = g_strdup(path_fs); - handle = Player_Load(path2, 128, 0); + char *path2 = g_strdup(path_fs); + MODULE *handle = Player_Load(path2, 128, 0); g_free(path2); if (handle == NULL) { @@ -193,19 +188,20 @@ mikmod_decoder_tag_dup(const char *path_fs) return NULL; } + Player_Free(handle); - ret = tag_new(); + struct tag *tag = tag_new(); - ret->time = 0; + tag->time = 0; path2 = g_strdup(path_fs); - title = g_strdup(Player_LoadTitle(path2)); + char *title = g_strdup(Player_LoadTitle(path2)); g_free(path2); if (title) - tag_add_item(ret, TAG_TITLE, title); + tag_add_item(tag, TAG_TITLE, title); - return ret; + return tag; } static const char *const mikmod_decoder_suffixes[] = { -- cgit v1.2.3