aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-10-16 17:39:17 +0200
committerMax Kellermann <max@duempel.org>2009-10-16 17:39:17 +0200
commitd09e19c3dc6216ff0b3b4a69a778e45482ae66c5 (patch)
tree0296925b5eeb90bd3d146fc7b04261af6123801d /src/decoder
parent8ae5bc4d790d026a25049dd213814429ff8c8b2b (diff)
downloadmpd-d09e19c3dc6216ff0b3b4a69a778e45482ae66c5.tar.gz
mpd-d09e19c3dc6216ff0b3b4a69a778e45482ae66c5.tar.xz
mpd-d09e19c3dc6216ff0b3b4a69a778e45482ae66c5.zip
decoder/flac: fixed two memory leaks in the CUE tag loader
Don't initialize "vc" and "cs" with FLAC__metadata_object_new(); that value is overwritten by FLAC__metadata_get_tags() and FLAC__metadata_get_cuesheet().
Diffstat (limited to '')
-rw-r--r--src/decoder/flac_plugin.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/decoder/flac_plugin.c b/src/decoder/flac_plugin.c
index 1d7a9f868..1d5d48d09 100644
--- a/src/decoder/flac_plugin.c
+++ b/src/decoder/flac_plugin.c
@@ -299,10 +299,10 @@ flac_cue_tag_load(const char *file)
unsigned int sample_rate = 0;
FLAC__uint64 track_time = 0;
#ifdef HAVE_CUE /* libcue */
- FLAC__StreamMetadata* vc = FLAC__metadata_object_new(FLAC__METADATA_TYPE_VORBIS_COMMENT);
+ FLAC__StreamMetadata* vc;
#endif /* libcue */
FLAC__StreamMetadata* si = FLAC__metadata_object_new(FLAC__METADATA_TYPE_STREAMINFO);
- FLAC__StreamMetadata* cs = FLAC__metadata_object_new(FLAC__METADATA_TYPE_CUESHEET);
+ FLAC__StreamMetadata* cs;
tnum = flac_vtrack_tnum(file);
char_tnum = g_strdup_printf("%u", tnum);
@@ -326,6 +326,7 @@ flac_cue_tag_load(const char *file)
}
}
}
+
FLAC__metadata_object_delete(vc);
}
#endif /* libcue */