mirror of
https://gitlab.freedesktop.org/pipewire/wireplumber.git
synced 2025-12-20 01:50:04 +01:00
m-mixer-api: Fix memory in leak wp_mixer_api_set_volume
Declare result from wp_object_manager_lookup as g_autoptr, to prevent leaking memory.
This commit is contained in:
parent
b68a6794cd
commit
255b65d182
1 changed files with 2 additions and 2 deletions
|
|
@ -501,7 +501,7 @@ wp_mixer_api_set_volume (WpMixerApi * self, guint32 id, GVariant * vvolume)
|
|||
props = wp_spa_pod_builder_end (b);
|
||||
|
||||
if (info->device_id != SPA_ID_INVALID) {
|
||||
WpPipewireObject *device = wp_object_manager_lookup (self->om,
|
||||
g_autoptr (WpPipewireObject) device = wp_object_manager_lookup (self->om,
|
||||
WP_TYPE_DEVICE, WP_CONSTRAINT_TYPE_G_PROPERTY,
|
||||
"bound-id", "=u", info->device_id, NULL);
|
||||
g_return_val_if_fail (device != NULL, FALSE);
|
||||
|
|
@ -514,7 +514,7 @@ wp_mixer_api_set_volume (WpMixerApi * self, guint32 id, GVariant * vvolume)
|
|||
"save", "b", true,
|
||||
NULL));
|
||||
} else {
|
||||
WpPipewireObject *node = wp_object_manager_lookup (self->om,
|
||||
g_autoptr (WpPipewireObject) node = wp_object_manager_lookup (self->om,
|
||||
WP_TYPE_NODE, WP_CONSTRAINT_TYPE_G_PROPERTY,
|
||||
"bound-id", "=u", id, NULL);
|
||||
g_return_val_if_fail (node != NULL, FALSE);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue