summaryrefslogtreecommitdiff
path: root/src/irc/core/massjoin.c
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2000-07-02 16:24:28 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2000-07-02 16:24:28 +0000
commitc451c94c6838223e7476104b3c52924eff9b9924 (patch)
tree8bb5471d69732ec1cce55fc2d7efecb737d175c1 /src/irc/core/massjoin.c
parentbb76eec0ffc836eaaccd35c2979fc092f1a9c520 (diff)
downloadirssi-c451c94c6838223e7476104b3c52924eff9b9924.zip
Minor memleak fixed.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@415 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/irc/core/massjoin.c')
-rw-r--r--src/irc/core/massjoin.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/irc/core/massjoin.c b/src/irc/core/massjoin.c
index 51831a1a..649e8c37 100644
--- a/src/irc/core/massjoin.c
+++ b/src/irc/core/massjoin.c
@@ -66,19 +66,22 @@ static void event_join(const char *data, IRC_SERVER_REC *server, const char *nic
chanrec->last_massjoins = 0;
}
- /* Check if user is already in some other channel,
- get the realname from there */
- nicks = nicklist_get_same(server, nick);
- for (tmp = nicks; tmp != NULL; tmp = tmp->next->next) {
- NICK_REC *rec = tmp->next->data;
-
- if (rec->realname != NULL) {
- nickrec->last_check = rec->last_check;
- nickrec->realname = g_strdup(rec->realname);
- nickrec->gone = rec->gone;
+ if (nickrec->realname == NULL) {
+ /* Check if user is already in some other channel,
+ get the realname and other stuff from there */
+ nicks = nicklist_get_same(server, nick);
+ for (tmp = nicks; tmp != NULL; tmp = tmp->next->next) {
+ NICK_REC *rec = tmp->next->data;
+
+ if (rec->realname != NULL) {
+ nickrec->last_check = rec->last_check;
+ nickrec->realname = g_strdup(rec->realname);
+ nickrec->gone = rec->gone;
+ break;
+ }
}
+ g_slist_free(nicks);
}
- g_slist_free(nicks);
chanrec->massjoins++;
}