From 6f771b1685d6a8ea0391d4048e90e7042a7bc870 Mon Sep 17 00:00:00 2001 From: Evangelos Ribeiro Tzaras Date: Wed, 18 Jan 2023 21:00:36 +0100 Subject: [PATCH] mm-origin: Avoid unnecessary allocation --- plugins/provider/mm/calls-mm-origin.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/plugins/provider/mm/calls-mm-origin.c b/plugins/provider/mm/calls-mm-origin.c index d727f6e..3afa189 100644 --- a/plugins/provider/mm/calls-mm-origin.c +++ b/plugins/provider/mm/calls-mm-origin.c @@ -551,7 +551,6 @@ call_deleted_cb (MMModemVoice *voice, { gpointer call; gpointer key; - GString *reason; const char *mm_reason; g_debug ("Removing call `%s'", path); @@ -565,17 +564,13 @@ call_deleted_cb (MMModemVoice *voice, return; } - reason = g_string_new ("Call removed"); - mm_reason = calls_mm_call_get_disconnect_reason (CALLS_MM_CALL (call)); - if (mm_reason) { - g_string_assign (reason, mm_reason); - } - - g_signal_emit_by_name (self, "call-removed", call, reason); + g_signal_emit_by_name (self, + "call-removed", + call, + mm_reason ?: "Call removed"); g_object_unref (call); - g_string_free (reason, TRUE); g_debug ("Removed call `%s'", path); }