diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2012-02-08 13:57:00 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2012-03-15 14:15:01 +0100 |
commit | e257c4ac499d0e9e12d27d74de435e4a0fc8d98e (patch) | |
tree | bee606e2c2b0a310c7cdef09f07e969d022f21aa /cli | |
parent | 0833934f11e96916e2ffe188cc6808350b70a95d (diff) |
cli: avoid unneeded refs when synchronously looking for bearer/sms/sim
Diffstat (limited to 'cli')
-rw-r--r-- | cli/mmcli-common.c | 6 |
1 files 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); |