aboutsummaryrefslogtreecommitdiffstats
path: root/src/decode.c
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2004-05-18 13:19:30 +0000
committerWarren Dukes <warren.dukes@gmail.com>2004-05-18 13:19:30 +0000
commit3a5a75cf87c5b952a946224a37cf9c1c6ba45d7f (patch)
tree318cb5be633d595c2235a45948b468b8a82a8a33 /src/decode.c
parentc51ad71efaa975c64f6ad31dce5578307a5cba7b (diff)
downloadmpd-3a5a75cf87c5b952a946224a37cf9c1c6ba45d7f.tar.gz
mpd-3a5a75cf87c5b952a946224a37cf9c1c6ba45d7f.tar.xz
mpd-3a5a75cf87c5b952a946224a37cf9c1c6ba45d7f.zip
fix a mem leak when unknow type in decodeStart()
git-svn-id: https://svn.musicpd.org/mpd/trunk@1063 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/decode.c')
-rw-r--r--src/decode.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/decode.c b/src/decode.c
index c990edc9e..49babb31f 100644
--- a/src/decode.c
+++ b/src/decode.c
@@ -238,9 +238,9 @@ void decodeStart(PlayerControl * pc, OutputBuffer * cb, DecoderControl * dc) {
0 == strcmp(inStream.mime, "audio/mpeg")))
{
ret = mp3_decode(cb,dc,&inStream);
+ break;
}
else ret = DECODE_ERROR_UNKTYPE;
- break;
#endif
case DECODE_TYPE_FILE:
#ifdef HAVE_MAD
@@ -285,10 +285,11 @@ void decodeStart(PlayerControl * pc, OutputBuffer * cb, DecoderControl * dc) {
default:
ret = DECODE_ERROR_UNKTYPE;
}
- if(ret<0) {
+ if(ret<0 || ret == DECODE_ERROR_UNKTYPE) {
strncpy(pc->erroredFile, dc->file, MAXPATHLEN);
pc->erroredFile[MAXPATHLEN] = '\0';
if(ret != DECODE_ERROR_UNKTYPE) dc->error = DECODE_ERROR_FILE;
+ else closeInputStream(&inStream);
dc->start = 0;
dc->stop = 0;
dc->state = DECODE_STATE_STOP;