module-echo-cancel: fix leak on error

Don't leak the properties on error.
Use and log the error returned from the init function.
This commit is contained in:
Wim Taymans 2022-02-22 17:27:33 +01:00
parent d06e13210d
commit 6769becac5

View file

@ -995,14 +995,16 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args)
else else
aec_props = pw_properties_new(NULL, NULL); aec_props = pw_properties_new(NULL, NULL);
if (spa_audio_aec_init(impl->aec, &aec_props->dict, &impl->info)) { res = spa_audio_aec_init(impl->aec, &aec_props->dict, &impl->info);
pw_log_error("codec plugin %s create failed", impl->aec->name);
res = -ENOENT;
goto error;
}
pw_properties_free(aec_props); pw_properties_free(aec_props);
if (res < 0) {
pw_log_error("codec plugin %s create failed: %s", impl->aec->name,
spa_strerror(res));
goto error;
}
if (impl->aec->latency) { if (impl->aec->latency) {
unsigned int num, denom, req_num, req_denom; unsigned int num, denom, req_num, req_denom;
unsigned int factor = 0; unsigned int factor = 0;