The IRC_KillClient() function is documented to handle the case that the
"Client" structure is NULL, so make sure that this actually works and
can't crash the daemon.
Please note:
The current code doesn't make use of this feature, so this fix is
definitely the "right" thing to do but doesn't fix an actual problem.
IRC_KillClient(CLIENT *Client, CLIENT *From, const char *Nick, const char *Reason)
{
const char *msg;
- CONN_ID my_conn, conn;
+ CONN_ID my_conn = NONE, conn;
CLIENT *c;
+ assert(Nick != NULL);
+ assert(Reason != NULL);
+
/* Do we know such a client in the network? */
c = Client_Search(Nick);
if (!c) {
}
/* Save ID of this connection */
- my_conn = Client_Conn(Client);
+ if (Client)
+ my_conn = Client_Conn(Client);
/* Kill the client NOW:
* - Close the local connection (if there is one),