summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill Thompson <will.thompson@collabora.co.uk>2012-07-02 15:19:21 +0100
committerWill Thompson <will.thompson@collabora.co.uk>2012-11-16 10:08:45 +0000
commit6199eab3f074c3159b31389a37e432bf9f69cd76 (patch)
treeb27c517ab025b8cac593d454d50cca29da8e8a9b
parentc452d94fabbdf31c85963c81df3d5d566148f968 (diff)
downloadtelepathy-salut-6199eab3f074c3159b31389a37e432bf9f69cd76.tar.gz
tubes: don't use an uninitialized tube_id.
gcc rightly points out that tube_id may be uninitialized if extract_tube_information() returns false.
-rw-r--r--src/tubes-channel.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/tubes-channel.c b/src/tubes-channel.c
index c847208a..289eb3b3 100644
--- a/src/tubes-channel.c
+++ b/src/tubes-channel.c
@@ -653,14 +653,19 @@ salut_tubes_channel_muc_message_received (SalutTubesChannel *self,
{
WockyNode *tube_node = (WockyNode *) l->data;
const gchar *stream_id;
- SalutTubeIface *tube;
+ SalutTubeIface *tube = NULL;
guint tube_id;
TpTubeType type;
stream_id = wocky_node_get_attribute (tube_node, "stream-id");
- extract_tube_information (self, tube_node, NULL,
- NULL, NULL, NULL, &tube_id);
+ if (!extract_tube_information (self, tube_node, NULL,
+ NULL, NULL, NULL, &tube_id))
+ {
+ DEBUG ("can't find a tube ID; never mind then.");
+ continue;
+ }
+
tube = g_hash_table_lookup (priv->tubes, GUINT_TO_POINTER (tube_id));
if (tube == NULL)