diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2008-10-22 12:23:27 +0100 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2008-10-22 12:34:29 +0100 |
commit | 1e63b1a50823c656cddf26fb85f8dea94d3d62ac (patch) | |
tree | 8be8d16ed5967b189626fcf7cc08b9208556ddf3 /src/conn-aliasing.c | |
parent | cc2a20e7c01bb4dce0281e90b89430d586002eaa (diff) |
GetAliases: don't leak a hash table if handles are invalid
Diffstat (limited to 'src/conn-aliasing.c')
-rw-r--r-- | src/conn-aliasing.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/conn-aliasing.c b/src/conn-aliasing.c index 6cc439a2b..a8050d94c 100644 --- a/src/conn-aliasing.c +++ b/src/conn-aliasing.c @@ -967,8 +967,7 @@ gabble_connection_get_aliases (TpSvcConnectionInterfaceAliasing *iface, TpBaseConnection *base = (TpBaseConnection *) self; TpHandleRepoIface *contact_handles = tp_base_connection_get_handles (base, TP_HANDLE_TYPE_CONTACT); - GHashTable *result = g_hash_table_new_full (g_direct_hash, g_direct_equal, - NULL, g_free); + GHashTable *result; GError *error = NULL; guint i; @@ -983,6 +982,9 @@ gabble_connection_get_aliases (TpSvcConnectionInterfaceAliasing *iface, return; } + result = g_hash_table_new_full (g_direct_hash, g_direct_equal, + NULL, g_free); + for (i = 0; i < contacts->len; i++) { TpHandle handle = g_array_index (contacts, TpHandle, i); |