cli: avoid unneeded refs when synchronously looking for bearer/sms/sim

This commit is contained in:
Aleksander Morgado
2012-02-08 13:57:00 +01:00
parent 0833934f11
commit e257c4ac49

View File

@@ -512,7 +512,7 @@ mmcli_get_bearer_sync (GDBusConnection *connection,
found = find_bearer_in_list (bearers, bearer_path); found = find_bearer_in_list (bearers, bearer_path);
g_list_free_full (bearers, (GDestroyNotify) g_object_unref); g_list_free_full (bearers, (GDestroyNotify) g_object_unref);
if (o_object) if (found && o_object)
*o_object = g_object_ref (object); *o_object = g_object_ref (object);
g_object_unref (modem); g_object_unref (modem);
@@ -732,7 +732,7 @@ mmcli_get_sim_sync (GDBusConnection *connection,
exit (EXIT_FAILURE); exit (EXIT_FAILURE);
} }
if (o_object) if (found && o_object)
*o_object = g_object_ref (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); found = find_sms_in_list (sms_list, sms_path);
g_list_free_full (sms_list, (GDestroyNotify) g_object_unref); g_list_free_full (sms_list, (GDestroyNotify) g_object_unref);
if (o_object) if (found && o_object)
*o_object = g_object_ref (object); *o_object = g_object_ref (object);
g_object_unref (modem); g_object_unref (modem);