Skip to content

Commit 6e4d54c

Browse files
committed
xapp-gpu-offload-helper.c: Fix a memory leak.
Noticed this while running cinnamon thru valgrind.
1 parent 458de98 commit 6e4d54c

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

libxapp/xapp-gpu-offload-helper.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,8 @@ helper_init_thread (GTask *task,
296296
{
297297
XAppGpuOffloadHelper *helper = XAPP_GPU_OFFLOAD_HELPER (source_object);
298298
XAppSwitcherooControl *control;
299+
g_autofree gchar *name_owner = NULL;
300+
299301
GError *error = NULL;
300302

301303
control = xapp_switcheroo_control_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
@@ -316,7 +318,9 @@ helper_init_thread (GTask *task,
316318
g_task_return_error (task, error);
317319
}
318320

319-
if (g_dbus_proxy_get_name_owner (G_DBUS_PROXY (control)) != NULL)
321+
name_owner = g_dbus_proxy_get_name_owner (G_DBUS_PROXY (control));
322+
323+
if (name_owner != NULL)
320324
{
321325
DEBUG ("Got switcheroo-control proxy successfully");
322326

0 commit comments

Comments
 (0)