aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--NEWS1
-rw-r--r--src/output/shout_mp3.c8
2 files changed, 7 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index 0190d4cc5..424c5ead3 100644
--- a/NEWS
+++ b/NEWS
@@ -43,6 +43,7 @@ ver 0.14.2 (2009/??/??)
- jack: allocate ring buffers before connecting
- jack: clear "shutdown" flag on reconnect
- jack: reduced sleep time to 1ms
+ - shout: fixed memory leak in the mp3 encoder
* mapper: remove trailing slashes from music_directory
* player: set player error when output device fails
diff --git a/src/output/shout_mp3.c b/src/output/shout_mp3.c
index eb95c8b3e..1369f6c80 100644
--- a/src/output/shout_mp3.c
+++ b/src/output/shout_mp3.c
@@ -19,6 +19,8 @@
#include "shout_plugin.h"
#include <lame/lame.h>
+
+#include <assert.h>
#include <stdlib.h>
struct lame_data {
@@ -45,6 +47,9 @@ static int shout_mp3_encoder_clear_encoder(struct shout_data *sd)
buf->len)) < 0)
g_warning("error flushing lame buffers\n");
+ lame_close(ld->gfp);
+ ld->gfp = NULL;
+
return (ret > 0);
}
@@ -52,8 +57,7 @@ static void shout_mp3_encoder_finish(struct shout_data *sd)
{
struct lame_data *ld = (struct lame_data *)sd->encoder_data;
- lame_close(ld->gfp);
- ld->gfp = NULL;
+ assert(ld->gfp == NULL);
g_free(ld);
}