Fix memory leak in _handle_topic_command() when returning without calling irc_unget_listelems() on variable 'e'

This commit is contained in:
RElesgoe 2016-08-28 02:46:51 -07:00
parent 71afce3904
commit 6870226159

View file

@ -1444,10 +1444,15 @@ namespace pvpgn
std::snprintf(temp, sizeof(temp), "%s :You're not on that channel", e[0]);
irc_send(conn, ERR_NOTONCHANNEL, temp);
}
irc_unget_listelems(e);
}
else
irc_send(conn, ERR_NEEDMOREPARAMS, "TOPIC :Not enough parameters");
if (e)
{
irc_unget_listelems(e);
}
return 0;
}