diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2007-07-02 23:12:03 +0100 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2007-07-02 23:12:03 +0100 |
commit | 9da0bbfd42609f0f3864b5a16a3c1c378b7217c9 (patch) | |
tree | 080ab25a0fd949429c33ba125b9df189807d0d3c /protocols/jabber/conference.c | |
parent | 5d7dc007a418be0c897000e888e747047729c756 (diff) |
Added (and using) jabber_chat_free() for better memory management, fixed
channel name generation code in root_commands.c and fixed one memory leak
in jabber_buddy_remove_bare().
Diffstat (limited to 'protocols/jabber/conference.c')
-rw-r--r-- | protocols/jabber/conference.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/protocols/jabber/conference.c b/protocols/jabber/conference.c index 24b5631a..f49dbd1c 100644 --- a/protocols/jabber/conference.c +++ b/protocols/jabber/conference.c @@ -64,6 +64,19 @@ struct groupchat *jabber_chat_join( struct im_connection *ic, char *room, char * return c; } +void jabber_chat_free( struct groupchat *c ) +{ + struct jabber_chat *jc = c->data; + + jabber_buddy_remove_bare( c->ic, jc->name ); + + g_free( jc->my_full_jid ); + g_free( jc->name ); + g_free( jc ); + + imcb_chat_free( c ); +} + int jabber_chat_msg( struct groupchat *c, char *message, int flags ) { struct im_connection *ic = c->ic; @@ -191,13 +204,7 @@ void jabber_chat_pkt_presence( struct im_connection *ic, struct jabber_buddy *bu if( s ) *s = '/'; if( bud == jc->me ) - { - jabber_buddy_remove_bare( ic, jc->name ); - - g_free( jc->name ); - g_free( jc ); - imcb_chat_free( chat ); - } + jabber_chat_free( chat ); } } |