wireplumber/0003-m-mixer-api-Fix-memory-in-leak-wp_mixer_api_set_volume.patch
Antonio Larrosa 61e522ecbd - Add patch from upstream to fix switching automatically the
profile of non-bluetooth devices (boo#1231815):
  * 0001-autoswitch-bluetooth-profile-switch-only-Bluetooth-devices.patch
- Add patch from upstream to fix switching automatically the
  profile when starting some apps and then switching to the
  previous profile:
  * 0002-autoswitch-bluetooth-profile-Switch-to-HSP_HFP-on-timeout.patch
- Add patches from upstream to fix a couple of memory leaks:
  * 0003-m-mixer-api-Fix-memory-in-leak-wp_mixer_api_set_volume.patch
  * 0004-module-dbus-connection-fix-GCancellable-leak.patch

OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/wireplumber?expand=0&rev=88
2024-10-21 16:00:28 +00:00

37 lines
1.5 KiB
Diff

From 255b65d18204f7cf5c0706308196ffbcf8f1a697 Mon Sep 17 00:00:00 2001
From: Torkel Niklasson <torkel@axis.com>
Date: Thu, 26 Sep 2024 12:01:18 +0200
Subject: [PATCH] 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.
---
modules/module-mixer-api.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules/module-mixer-api.c b/modules/module-mixer-api.c
index e9dccbab0..502640c68 100644
--- a/modules/module-mixer-api.c
+++ b/modules/module-mixer-api.c
@@ -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);
--
GitLab