[asterisk-commits] rizzo: trunk r47128 - /trunk/res/res_jabber.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri Nov 3 11:10:45 MST 2006


Author: rizzo
Date: Fri Nov  3 12:10:44 2006
New Revision: 47128

URL: http://svn.digium.com/view/asterisk?rev=47128&view=rev
Log:
move variable declarations to the beginning of a block.


Modified:
    trunk/res/res_jabber.c

Modified: trunk/res/res_jabber.c
URL: http://svn.digium.com/view/asterisk/trunk/res/res_jabber.c?rev=47128&r1=47127&r2=47128&view=diff
==============================================================================
--- trunk/res/res_jabber.c (original)
+++ trunk/res/res_jabber.c Fri Nov  3 12:10:44 2006
@@ -539,11 +539,12 @@
 									iks *x = NULL;
 									x = iks_new("auth");
 									if (x) {
-										iks_insert_attrib(x, "xmlns", IKS_NS_XMPP_SASL);
 										int len = strlen(client->jid->user) + strlen(client->password) + 3;
 										/* XXX Check return values XXX */
 										char *s = ast_malloc(80 + len);
 										char *base64 = ast_malloc(80 + len * 2);
+
+										iks_insert_attrib(x, "xmlns", IKS_NS_XMPP_SASL);
 										iks_insert_attrib(x, "mechanism", "PLAIN");
 										sprintf(s, "%c%s%c%s", 0, client->jid->user, 0, client->password);
 										ast_base64encode(base64, (const unsigned char *) s, len, len * 2);
@@ -708,8 +709,9 @@
 
 	buddy = ASTOBJ_CONTAINER_FIND(&client->buddies, pak->from->partial);
 	if (!buddy) {
+		iks *iq = NULL, *query = NULL, *error = NULL, *notacceptable = NULL;
+
 		ast_verbose("Someone.... %s tried to register but they aren't allowed\n", pak->from->partial);
-		iks *iq = NULL, *query = NULL, *error = NULL, *notacceptable = NULL;
 		iq = iks_new("iq");
 		query = iks_new("query");
 		error = iks_new("error");



More information about the asterisk-commits mailing list