aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Neuschäfer <j.neuschaefer@gmx.net>2011-07-18 15:39:19 +0200
committerMax Kellermann <max@duempel.org>2011-07-18 22:04:10 +0200
commita6a8bdffc35c3b592ca9eb908ef010a27ddbb3ed (patch)
treed092d3e72ba965b8e7dbc82ab4c6b3e7c9c721d9
parent296085ff23f3992f0f45fc0325c5bdbab953e114 (diff)
downloadmpd-a6a8bdffc35c3b592ca9eb908ef010a27ddbb3ed.tar.gz
mpd-a6a8bdffc35c3b592ca9eb908ef010a27ddbb3ed.tar.xz
mpd-a6a8bdffc35c3b592ca9eb908ef010a27ddbb3ed.zip
output/recorder: fix a memory leak
Diffstat (limited to '')
-rw-r--r--src/output/recorder_output_plugin.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/output/recorder_output_plugin.c b/src/output/recorder_output_plugin.c
index c01d927c4..10d64106c 100644
--- a/src/output/recorder_output_plugin.c
+++ b/src/output/recorder_output_plugin.c
@@ -79,23 +79,27 @@ recorder_output_init(G_GNUC_UNUSED const struct audio_format *audio_format,
if (encoder_plugin == NULL) {
g_set_error(error_r, recorder_output_quark(), 0,
"No such encoder: %s", encoder_name);
- return NULL;
+ goto failure;
}
recorder->path = config_get_block_string(param, "path", NULL);
if (recorder->path == NULL) {
g_set_error(error_r, recorder_output_quark(), 0,
"'path' not configured");
- return NULL;
+ goto failure;
}
/* initialize encoder */
recorder->encoder = encoder_init(encoder_plugin, param, error_r);
if (recorder->encoder == NULL)
- return NULL;
+ goto failure;
return recorder;
+
+failure:
+ g_free(recorder);
+ return NULL;
}
static void