aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2012-10-01 23:18:33 +0200
committerMax Kellermann <max@duempel.org>2012-10-02 00:17:27 +0200
commitc7748fedab96da650c81f8a9fad7ec61a3bd96df (patch)
tree59fd87906eb254e008530d8a65b6d588476d2901
parentc392efb4810319fef34b1230185dd0124c4dfb30 (diff)
downloadmpd-c7748fedab96da650c81f8a9fad7ec61a3bd96df.tar.gz
mpd-c7748fedab96da650c81f8a9fad7ec61a3bd96df.tar.xz
mpd-c7748fedab96da650c81f8a9fad7ec61a3bd96df.zip
output/shout: fix memory leak in error handler
-rw-r--r--NEWS3
-rw-r--r--src/output/shout_output_plugin.c9
2 files changed, 9 insertions, 3 deletions
diff --git a/NEWS b/NEWS
index 5ff831097..46963f308 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,6 @@
ver 0.17.3 (2012/??/??)
-
+* output:
+ - shout: fix memory leak in error handler
ver 0.17.2 (2012/09/30)
* protocol:
diff --git a/src/output/shout_output_plugin.c b/src/output/shout_output_plugin.c
index d6805f542..bebc5e5da 100644
--- a/src/output/shout_output_plugin.c
+++ b/src/output/shout_output_plugin.c
@@ -439,8 +439,13 @@ my_shout_open_device(struct audio_output *ao, struct audio_format *audio_format,
sd->buf.len = 0;
- if (!encoder_open(sd->encoder, audio_format, error) ||
- !write_page(sd, error)) {
+ if (!encoder_open(sd->encoder, audio_format, error)) {
+ shout_close(sd->shout_conn);
+ return false;
+ }
+
+ if (!write_page(sd, error)) {
+ encoder_close(sd->encoder);
shout_close(sd->shout_conn);
return false;
}