From 21167d2d14c333d67445546bb69dd52dd295287d Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Wed, 20 Sep 2006 21:42:27 +0200 Subject: It can send a valid (pre-XMPP) login packet. Lots of work to do, still... --- protocols/jabber/xmltree.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'protocols/jabber/xmltree.c') diff --git a/protocols/jabber/xmltree.c b/protocols/jabber/xmltree.c index 68c9560d..3d0a2919 100644 --- a/protocols/jabber/xmltree.c +++ b/protocols/jabber/xmltree.c @@ -205,7 +205,9 @@ void xt_cleanup( struct xt_parser *xt, struct xt_node *node ) { struct xt_node *c, *prev; - /* Let's just hope xt->root isn't NULL! */ + if( !xt || !xt->root ) + return; + if( node == NULL ) return xt_cleanup( xt, xt->root ); @@ -356,6 +358,9 @@ void xt_free_node( struct xt_node *node ) { int i; + if( !node ) + return; + g_free( node->name ); g_free( node->text ); @@ -379,6 +384,9 @@ void xt_free_node( struct xt_node *node ) void xt_free( struct xt_parser *xt ) { + if( !xt ) + return; + if( xt->root ) xt_free_node( xt->root ); @@ -407,6 +415,9 @@ char *xt_find_attr( struct xt_node *node, char *key ) { int i; + if( !node ) + return NULL; + for( i = 0; node->attr[i].key; i ++ ) if( g_strcasecmp( node->attr[i].key, key ) == 0 ) break; -- cgit v1.2.3