summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/plugins/irc/irc-channel.c6
-rw-r--r--tests/unit/core/test-core-list.cpp3
2 files changed, 5 insertions, 4 deletions
diff --git a/src/plugins/irc/irc-channel.c b/src/plugins/irc/irc-channel.c
index ddf3f81e3..ce2dca01e 100644
--- a/src/plugins/irc/irc-channel.c
+++ b/src/plugins/irc/irc-channel.c
@@ -1544,10 +1544,8 @@ irc_channel_free (struct t_irc_server *server, struct t_irc_channel *channel)
free (channel->away_message);
free (channel->pv_remote_nick_color);
weechat_unhook (channel->hook_autorejoin);
- if (channel->nicks_speaking[0])
- weechat_list_free (channel->nicks_speaking[0]);
- if (channel->nicks_speaking[1])
- weechat_list_free (channel->nicks_speaking[1]);
+ weechat_list_free (channel->nicks_speaking[0]);
+ weechat_list_free (channel->nicks_speaking[1]);
irc_channel_nick_speaking_time_free_all (channel);
weechat_hashtable_free (channel->join_smart_filtered);
free (channel->buffer_as_string);
diff --git a/tests/unit/core/test-core-list.cpp b/tests/unit/core/test-core-list.cpp
index 91f9031dd..69c79c557 100644
--- a/tests/unit/core/test-core-list.cpp
+++ b/tests/unit/core/test-core-list.cpp
@@ -142,6 +142,9 @@ TEST(CoreList, Add)
/* free list */
weelist_free (list);
+
+ /* test free of NULL list */
+ weelist_free (NULL);
}
/*