From 5379907cf86092d1f3fe3c2d46917022bfb41f94 Mon Sep 17 00:00:00 2001 From: Evangelos Ribeiro Tzaras Date: Wed, 18 Jan 2023 21:14:46 +0100 Subject: [PATCH] mm-origin: Don't leak MMModem mm_object_get_modem() is transfer full, so we need to unref it when we're done. --- plugins/provider/mm/calls-mm-origin.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/provider/mm/calls-mm-origin.c b/plugins/provider/mm/calls-mm-origin.c index 5433195..1e6ccca 100644 --- a/plugins/provider/mm/calls-mm-origin.c +++ b/plugins/provider/mm/calls-mm-origin.c @@ -781,14 +781,16 @@ get_sim_ready_cb (MMModem *modem, static void constructed (GObject *object) { + g_autoptr (MMModem) modem = NULL; CallsMMOrigin *self = CALLS_MM_ORIGIN (object); MmGdbusModemVoice *gdbus_voice; G_OBJECT_CLASS (calls_mm_origin_parent_class)->constructed (object); - self->name = modem_get_name (mm_object_get_modem (self->mm_obj)); + modem = mm_object_get_modem (self->mm_obj); + self->name = modem_get_name (modem); - mm_modem_get_sim (mm_object_get_modem (self->mm_obj), + mm_modem_get_sim (modem, NULL, (GAsyncReadyCallback) get_sim_ready_cb, self);