summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/modules.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/modules.cpp b/src/modules.cpp
index bda6f765b..f09c85d08 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -428,11 +428,15 @@ void Server::KickUser(userrec* source, userrec* target, chanrec* chan, const std
{
if (source)
{
- chan->KickUser(source, target, reason.c_str());
+ if (!chan->KickUser(source, target, reason.c_str()))
+ /* No users left? */
+ delete chan;
}
else
{
- chan->ServerKickUser(target, reason.c_str(), true);
+ if (!chan->ServerKickUser(target, reason.c_str(), true))
+ /* No users left? */
+ delete chan;
}
}