From 0265c34bed4bdfd45a4ef1b5ff73071c5d5a5e10 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 30 Jun 2010 23:40:04 +0200 Subject: [PATCH] decoder/ffmpeg: free URI, fix memory leak Free the string allocated by decoder_get_uri(). --- NEWS | 1 + src/decoder/ffmpeg_plugin.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index fac8ec6fd..3ae9fc7f3 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,7 @@ ver 0.15.11 (2010/??/??) - mp4ff: support tags "album artist", "albumartist", "band" - mikmod: fix memory leak - vorbis: handle uri==NULL + - ffmpeg: fix memory leak - ffmpeg: free AVFormatContext on error - ffmpeg: read more metadata * playlist: emit IDLE_OPTIONS when resetting single mode diff --git a/src/decoder/ffmpeg_plugin.c b/src/decoder/ffmpeg_plugin.c index 7f2207669..fc402ca04 100644 --- a/src/decoder/ffmpeg_plugin.c +++ b/src/decoder/ffmpeg_plugin.c @@ -376,8 +376,10 @@ ffmpeg_decode(struct decoder *decoder, struct input_stream *input) ctx.input = input; ctx.decoder = decoder; - ffmpeg_helper(decoder_get_uri(decoder), input, + char *uri = decoder_get_uri(decoder); + ffmpeg_helper(uri, input, ffmpeg_decode_internal, &ctx); + g_free(uri); } #if LIBAVFORMAT_VERSION_INT >= ((52<<16)+(31<<8)+0)