output/recorder: fix a memory leak
This commit is contained in:
parent
296085ff23
commit
a6a8bdffc3
@ -79,23 +79,27 @@ recorder_output_init(G_GNUC_UNUSED const struct audio_format *audio_format,
|
|||||||
if (encoder_plugin == NULL) {
|
if (encoder_plugin == NULL) {
|
||||||
g_set_error(error_r, recorder_output_quark(), 0,
|
g_set_error(error_r, recorder_output_quark(), 0,
|
||||||
"No such encoder: %s", encoder_name);
|
"No such encoder: %s", encoder_name);
|
||||||
return NULL;
|
goto failure;
|
||||||
}
|
}
|
||||||
|
|
||||||
recorder->path = config_get_block_string(param, "path", NULL);
|
recorder->path = config_get_block_string(param, "path", NULL);
|
||||||
if (recorder->path == NULL) {
|
if (recorder->path == NULL) {
|
||||||
g_set_error(error_r, recorder_output_quark(), 0,
|
g_set_error(error_r, recorder_output_quark(), 0,
|
||||||
"'path' not configured");
|
"'path' not configured");
|
||||||
return NULL;
|
goto failure;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* initialize encoder */
|
/* initialize encoder */
|
||||||
|
|
||||||
recorder->encoder = encoder_init(encoder_plugin, param, error_r);
|
recorder->encoder = encoder_init(encoder_plugin, param, error_r);
|
||||||
if (recorder->encoder == NULL)
|
if (recorder->encoder == NULL)
|
||||||
return NULL;
|
goto failure;
|
||||||
|
|
||||||
return recorder;
|
return recorder;
|
||||||
|
|
||||||
|
failure:
|
||||||
|
g_free(recorder);
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
x
Reference in New Issue
Block a user