Changeset 15581c1


Ignore:
Timestamp:
2012-06-05T22:34:13Z (12 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
aa88e50
Parents:
222b440
Message:

Fixed some small leaks, restored proper read buffer size.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • storage_xml.c

    r222b440 r15581c1  
    6767        {
    6868                char *name = xt_find_attr( c, "name" );
     69               
     70                if( !name )
     71                        continue;
    6972               
    7073                if( strcmp( node->name, "account" ) == 0 )
     
    169172{
    170173        struct xml_parsedata xd[1];
    171         char *fn, buf[204];
     174        char *fn, buf[2048];
    172175        int fd, st;
    173176        struct xt_parser *xp;
     
    225228       
    226229        /* DO NOT call xt_handle() before verifying the password! */
    227         if( xt_handle( xp, NULL, -1 ) == XT_HANDLED )
     230        if( xt_handle( xp, NULL, 1 ) == XT_HANDLED )
    228231                ret = STORAGE_OK;
    229232       
     
    231234       
    232235error:
     236        xt_free( xp );
     237        g_free( fn );
    233238        return ret;
    234239}
     
    349354}
    350355
     356static gboolean xml_generate_nick( gpointer key, gpointer value, gpointer data )
     357{
     358        struct xt_node *node = xt_new_node( "buddy", NULL, NULL );
     359        xt_add_attr( node, "handle", key );
     360        xt_add_attr( node, "nick", value );
     361        xt_add_child( (struct xt_node *) data, node );
     362       
     363        return FALSE;
     364}
     365
    351366static storage_status_t xml_save( irc_t *irc, int overwrite )
    352367{
     
    401416       
    402417        return ret;
    403 }
    404 
    405 static gboolean xml_generate_nick( gpointer key, gpointer value, gpointer data )
    406 {
    407         struct xt_node *node = xt_new_node( "buddy", NULL, NULL );
    408         xt_add_attr( node, "handle", key );
    409         xt_add_attr( node, "nick", value );
    410         xt_add_child( (struct xt_node *) data, node );
    411        
    412         return FALSE;
    413418}
    414419
Note: See TracChangeset for help on using the changeset viewer.