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-07-02 15:19:21 +0100
commit4f470ee12f43f0eed298cb9fd703cd990f3fbf75 (patch)
tree5ddaf072ca842e52d71a60f82be15ae2f9892370
parent9156cecdd2473e065a3d7104bc6233306c166106 (diff)
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)