summaryrefslogtreecommitdiff
path: root/src/irc/notifylist/notifylist.c
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2001-12-03 19:51:00 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2001-12-03 19:51:00 +0000
commit84abc35a81655cfa5b0ea2a2e0d9780da9e0d8f2 (patch)
tree46219957ac21bea99af40fe38a5c2524cd32809d /src/irc/notifylist/notifylist.c
parentaa3513eaaf44bbdde6f05d605ab5b54fe3f031a5 (diff)
downloadirssi-84abc35a81655cfa5b0ea2a2e0d9780da9e0d8f2.zip
Fixed a memory leak and a crash when notifylist_check_join() was called with NULL realname.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2185 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/irc/notifylist/notifylist.c')
-rw-r--r--src/irc/notifylist/notifylist.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/irc/notifylist/notifylist.c b/src/irc/notifylist/notifylist.c
index 0d2b5c21..39806769 100644
--- a/src/irc/notifylist/notifylist.c
+++ b/src/irc/notifylist/notifylist.c
@@ -232,6 +232,8 @@ void notifylist_left(IRC_SERVER_REC *server, NOTIFY_NICK_REC *rec)
rec->user, rec->host,
rec->realname, rec->awaymsg);
}
+
+ notify_nick_destroy(rec);
}
static void notifylist_idle_reset(IRC_SERVER_REC *server, const char *nick)
@@ -297,7 +299,7 @@ static void notifylist_check_join(IRC_SERVER_REC *server, const char *nick,
g_free_not_null(rec->realname);
rec->user = g_strdup(user);
rec->host = g_strdup(host);
- rec->realname = *realname == '\0' ? NULL : g_strdup(realname);
+ rec->realname = realname == NULL || *realname == '\0' ? NULL : g_strdup(realname);
if (away != -1) rec->away = away;
rec->host_ok = TRUE;