audioadapter: clear the handle as well to avoid leaks

This commit is contained in:
Wim Taymans 2024-09-09 13:42:44 +02:00
parent ffed9763fd
commit 5c2b5fa552

View file

@ -1801,8 +1801,10 @@ static int load_converter(struct impl *this, const struct spa_dict *info,
if (iface_conv == NULL) {
if (unload_handle)
spa_plugin_loader_unload(this->ploader, hnd_convert);
else
else {
spa_handle_clear(hnd_convert);
free(hnd_convert);
}
return -EINVAL;
}
@ -1938,8 +1940,10 @@ static int impl_clear(struct spa_handle *handle)
if (this->hnd_convert) {
if (this->unload_handle)
spa_plugin_loader_unload(this->ploader, this->hnd_convert);
else
else {
spa_handle_clear(this->hnd_convert);
free(this->hnd_convert);
}
free(this->convertname);
}