From 7d4ffc2ebc29ff8e6771722e8fab41cf690711f2 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Fri, 17 Feb 2012 11:20:28 +0100 Subject: 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. --- irc_channel.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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" ); -- cgit v1.2.3