aboutsummaryrefslogtreecommitdiffstats
path: root/irc_channel.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2012-02-17 11:20:28 +0100
committerWilmer van der Gaast <wilmer@gaast.net>2012-02-17 11:20:28 +0100
commit7d4ffc2ebc29ff8e6771722e8fab41cf690711f2 (patch)
treedb68e9978f530619544f66e651fe195369397378 /irc_channel.c
parentdcf155d79a41a747ae73e51e028c6085f28dc30f (diff)
Fixing NULL pointer dereference in irc_channel_free(). This seems to happen
for example when the user gets invited to a channel that already exists. Separately, I should handle invites like that better. Will file a bug for that.
Diffstat (limited to 'irc_channel.c')
-rw-r--r--irc_channel.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/irc_channel.c b/irc_channel.c
index 03fe93e9..7dc9f885 100644
--- a/irc_channel.c
+++ b/irc_channel.c
@@ -115,9 +115,13 @@ irc_channel_t *irc_channel_get( irc_t *irc, char *id )
int irc_channel_free( irc_channel_t *ic )
{
- irc_t *irc = ic->irc;
+ irc_t *irc;
GSList *l;
+ if( ic == NULL )
+ return 0;
+ irc = ic->irc;
+
if( ic->flags & IRC_CHANNEL_JOINED )
irc_channel_del_user( ic, irc->user, IRC_CDU_KICK, "Cleaning up channel" );