From e257c4ac499d0e9e12d27d74de435e4a0fc8d98e Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Wed, 8 Feb 2012 13:57:00 +0100 Subject: [PATCH] cli: avoid unneeded refs when synchronously looking for bearer/sms/sim --- cli/mmcli-common.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cli/mmcli-common.c b/cli/mmcli-common.c index 80d98564..d373c1bc 100644 --- a/cli/mmcli-common.c +++ b/cli/mmcli-common.c @@ -512,7 +512,7 @@ mmcli_get_bearer_sync (GDBusConnection *connection, found = find_bearer_in_list (bearers, bearer_path); g_list_free_full (bearers, (GDestroyNotify) g_object_unref); - if (o_object) + if (found && o_object) *o_object = g_object_ref (object); g_object_unref (modem); @@ -732,7 +732,7 @@ mmcli_get_sim_sync (GDBusConnection *connection, exit (EXIT_FAILURE); } - if (o_object) + if (found && o_object) *o_object = g_object_ref (object); } @@ -998,7 +998,7 @@ mmcli_get_sms_sync (GDBusConnection *connection, found = find_sms_in_list (sms_list, sms_path); g_list_free_full (sms_list, (GDestroyNotify) g_object_unref); - if (o_object) + if (found && o_object) *o_object = g_object_ref (object); g_object_unref (modem);