aboutsummaryrefslogtreecommitdiffstats
path: root/protocols/jabber/xmltree.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2006-09-20 21:42:27 +0200
committerWilmer van der Gaast <wilmer@gaast.net>2006-09-20 21:42:27 +0200
commit21167d2d14c333d67445546bb69dd52dd295287d (patch)
tree50c010702a3487c666ad8e614b25879de258d9cf /protocols/jabber/xmltree.c
parentf06894d8f55b50b632c1d81ad878f8581273ba66 (diff)
It can send a valid (pre-XMPP) login packet. Lots of work to do, still...
Diffstat (limited to 'protocols/jabber/xmltree.c')
-rw-r--r--protocols/jabber/xmltree.c13
1 files changed, 12 insertions, 1 deletions
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;