diff options
-rw-r--r-- | protocols/nogaim.c | 8 | ||||
-rw-r--r-- | user.c | 1 |
2 files changed, 7 insertions, 2 deletions
diff --git a/protocols/nogaim.c b/protocols/nogaim.c index 6c564c8c..a1a97dc3 100644 --- a/protocols/nogaim.c +++ b/protocols/nogaim.c @@ -446,7 +446,7 @@ void imcb_rename_buddy( struct im_connection *ic, char *handle, char *realname ) void imcb_buddy_nick_hint( struct im_connection *ic, char *handle, char *nick ) { user_t *u = user_findhandle( ic, handle ); - char newnick[MAX_NICK_LENGTH+1]; + char newnick[MAX_NICK_LENGTH+1], *orig_nick; if( u && !u->online && !nick_saved( ic->acc, handle ) ) { @@ -464,7 +464,11 @@ void imcb_buddy_nick_hint( struct im_connection *ic, char *handle, char *nick ) nick_dedupe( ic->acc, handle, newnick ); - user_rename( ic->irc, u->nick, newnick ); + /* u->nick will be freed halfway the process, so it can't be + passed as an argument. */ + orig_nick = g_strdup( u->nick ); + user_rename( ic->irc, orig_nick, newnick ); + g_free( orig_nick ); } } @@ -160,6 +160,7 @@ user_t *user_findhandle( struct im_connection *ic, char *handle ) return NULL; } +/* DO NOT PASS u->nick FOR oldnick !!! */ void user_rename( irc_t *irc, char *oldnick, char *newnick ) { user_t *u = user_find( irc, oldnick ); |