summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2014-04-16 17:22:58 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2014-04-17 14:22:30 +0100
commit683ba5e6c7268ac0bc10bdb0f03bd03dbe364732 (patch)
tree35a6492cdef60cdbc5f83fd30d8d64d60427b74e
parent9f9683a306d37b39c0f1d091b50fb0419c58221e (diff)
Fix some confusion over "&s" in variant-building
In C-to-GVariant conversions, "&s" does not mean "take ownership"; neither does it mean "assume statically-allocated, avoid copying or freeing". It is in fact exactly equivalent to "s" - i.e. "copy this string into the variant" - so use the simpler form instead.
-rw-r--r--telepathy-glib/base-connection.c3
-rw-r--r--telepathy-glib/base-contact-list.c3
-rw-r--r--telepathy-glib/handle-set.c4
3 files changed, 5 insertions, 5 deletions
diff --git a/telepathy-glib/base-connection.c b/telepathy-glib/base-connection.c
index 0087d4d97..11d6d86d1 100644
--- a/telepathy-glib/base-connection.c
+++ b/telepathy-glib/base-connection.c
@@ -821,8 +821,9 @@ manager_get_channel_details_foreach (TpBaseChannel *chan,
"channel-properties", &properties,
NULL);
- g_variant_builder_add (builder, "(&o@a{sv})", object_path, properties);
+ g_variant_builder_add (builder, "(o@a{sv})", object_path, properties);
g_variant_unref (properties);
+ g_free (object_path);
}
static void
diff --git a/telepathy-glib/base-contact-list.c b/telepathy-glib/base-contact-list.c
index 456418377..79bd6b980 100644
--- a/telepathy-glib/base-contact-list.c
+++ b/telepathy-glib/base-contact-list.c
@@ -1165,11 +1165,12 @@ tp_base_contact_list_contacts_changed_internal (TpBaseContactList *self,
_tp_base_contact_list_presence_state_to_letter (publish),
publish_request);
- g_variant_builder_add (&changes, "{u(uu&s)}", contact, subscribe,
+ g_variant_builder_add (&changes, "{u(uus)}", contact, subscribe,
publish, publish_request);
g_variant_builder_add (&change_ids, "{us}", contact,
tp_handle_inspect (self->priv->contact_repo, contact));
emit_signal = TRUE;
+ g_free (publish_request);
}
if (removed != NULL)
diff --git a/telepathy-glib/handle-set.c b/telepathy-glib/handle-set.c
index 3ccdb497d..ac91cdaef 100644
--- a/telepathy-glib/handle-set.c
+++ b/telepathy-glib/handle-set.c
@@ -322,9 +322,7 @@ tp_handle_set_to_identifier_map (
}
else
{
- /* We don't bother dupping the strings: they remain valid as long as
- * the connection's alive and hence the repo exists. */
- g_variant_builder_add (&builder, "{u&s}", handle,
+ g_variant_builder_add (&builder, "{us}", handle,
tp_handle_inspect (self->repo, handle));
}
}