aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/gme_decoder_plugin.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2010-05-31 09:43:25 +0200
committerMax Kellermann <max@duempel.org>2010-05-31 09:43:25 +0200
commitf0faf00320e66b30fa00b2e935698c3612abf76b (patch)
treee9a47611118b7935df681ab2982d502a28e118a6 /src/decoder/gme_decoder_plugin.c
parent51c7577c8fc32222a0a688a83e8bbdf6fbd85139 (diff)
downloadmpd-f0faf00320e66b30fa00b2e935698c3612abf76b.tar.gz
mpd-f0faf00320e66b30fa00b2e935698c3612abf76b.tar.xz
mpd-f0faf00320e66b30fa00b2e935698c3612abf76b.zip
decoder/gme: allocate tag later, fixes memory leak
Allocate the "tag" object after the file has been opened successfully.
Diffstat (limited to '')
-rw-r--r--src/decoder/gme_decoder_plugin.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/decoder/gme_decoder_plugin.c b/src/decoder/gme_decoder_plugin.c
index 4ca1b2eaf..cdabd36a6 100644
--- a/src/decoder/gme_decoder_plugin.c
+++ b/src/decoder/gme_decoder_plugin.c
@@ -80,7 +80,6 @@ gme_file_decode(struct decoder *decoder, const char *path_fs)
static struct tag *
gme_tag_dup(const char *path_fs)
{
- struct tag *tag = tag_new();
int sample_rate = 44100;
Music_Emu *emu;
gme_info_t *ti;
@@ -96,6 +95,7 @@ gme_tag_dup(const char *path_fs)
return NULL;
}
+ struct tag *tag = tag_new();
if(ti != NULL){
if(ti->length > 0)
tag->time = ti->length / 1000;