summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2014-06-02 15:00:54 +0200
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2014-06-03 13:27:11 +0200
commitf6383a5936f6d21572073f01c630c5c3641c2b52 (patch)
treed0ee6d1c4f91d4937585673e79d16a2a8db117f7
parentef311a22212a8a937c096a836e653e793ca73edd (diff)
wocky_jingle_session_parse: fix potential NULL deferencing
The caller of this function may pass NULL as @error so we shouldn't rely on it.
-rw-r--r--wocky/wocky-jingle-session.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/wocky/wocky-jingle-session.c b/wocky/wocky-jingle-session.c
index 02a96b1..60933f4 100644
--- a/wocky/wocky-jingle-session.c
+++ b/wocky/wocky-jingle-session.c
@@ -1671,6 +1671,7 @@ wocky_jingle_session_parse (
WockyJingleSessionPrivate *priv;
WockyNode *iq_node, *session_node;
const gchar *from, *action_name;
+ GError *e = NULL;
g_return_val_if_fail (WOCKY_IS_JINGLE_SESSION (sess), FALSE);
g_return_val_if_fail (WOCKY_IS_STANZA (stanza), FALSE);
@@ -1734,10 +1735,13 @@ wocky_jingle_session_parse (
return FALSE;
}
- wocky_jingle_state_machine_dance (sess, action, session_node, error);
+ wocky_jingle_state_machine_dance (sess, action, session_node, &e);
- if (*error != NULL)
- return FALSE;
+ if (e != NULL)
+ {
+ g_propagate_error (error, e);
+ return FALSE;
+ }
return TRUE;
}