108 const gchar *modestr; |
108 const gchar *modestr; |
109 |
109 |
110 js5b = g_new0(JingleSocks5, 1); |
110 js5b = g_new0(JingleSocks5, 1); |
111 modestr = lm_message_node_get_attribute(node, "mode"); |
111 modestr = lm_message_node_get_attribute(node, "mode"); |
112 js5b->mode = index_in_array(modestr, jingle_s5b_modes); |
112 js5b->mode = index_in_array(modestr, jingle_s5b_modes); |
113 js5b->sid = lm_message_node_get_attribute(node, "sid"); |
113 js5b->sid = g_strdup(lm_message_node_get_attribute(node, "sid")); |
114 |
114 |
115 if (!js5b->sid) { |
115 if (!js5b->sid) { |
116 g_set_error(err, JINGLE_CHECK_ERROR, JINGLE_CHECK_ERROR_MISSING, |
116 g_set_error(err, JINGLE_CHECK_ERROR, JINGLE_CHECK_ERROR_MISSING, |
117 "an attribute of the transport element is missing"); |
117 "an attribute of the transport element is missing"); |
118 g_free(js5b); |
118 g_free(js5b); |
121 |
121 |
122 for (node2 = node->children; node2; node2 = node2->next) { |
122 for (node2 = node->children; node2; node2 = node2->next) { |
123 if (!g_strcmp0(node->name, "candidate")) { |
123 if (!g_strcmp0(node->name, "candidate")) { |
124 const gchar *portstr, *prioritystr, *typestr; |
124 const gchar *portstr, *prioritystr, *typestr; |
125 JingleS5BCandidate *jc = g_new0(JingleS5BCandidate, 1); |
125 JingleS5BCandidate *jc = g_new0(JingleS5BCandidate, 1); |
126 jc->cid = lm_message_node_get_attribute(node2, "cid"); |
126 jc->cid = g_strdup(lm_message_node_get_attribute(node2, "cid")); |
127 jc->host = lm_message_node_get_attribute(node2, "host"); |
127 jc->host = g_strdup(lm_message_node_get_attribute(node2, "host")); |
128 jc->jid = lm_message_node_get_attribute(node2, "jid"); |
128 jc->jid = g_strdup(lm_message_node_get_attribute(node2, "jid")); |
129 portstr = lm_message_node_get_attribute(node2, "port"); |
129 portstr = lm_message_node_get_attribute(node2, "port"); |
130 prioritystr = lm_message_node_get_attribute(node2, "priority"); |
130 prioritystr = lm_message_node_get_attribute(node2, "priority"); |
131 typestr = lm_message_node_get_attribute(node2, "type"); |
131 typestr = lm_message_node_get_attribute(node2, "type"); |
132 |
132 |
133 if (!jc->cid || !jc->host || !jc->jid || !prioritystr) { |
133 if (!jc->cid || !jc->host || !jc->jid || !prioritystr) { |