]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - src/client.c
[svn] Fix a memory leak.
[irc/rqf/shadowircd.git] / src / client.c
index 6279a5660587d7bb064932694ac003bb09e35fab..0bed4ffc33baa8ac18d064db0f25f109733567e9 100644 (file)
@@ -21,7 +21,7 @@
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
  *  USA
  *
- *  $Id: client.c 3167 2007-01-26 18:52:11Z jilles $
+ *  $Id: client.c 3514 2007-06-06 16:25:21Z nenolod $
  */
 #include "stdinc.h"
 #include "config.h"
@@ -58,6 +58,7 @@
 #include "msg.h"
 #include "monitor.h"
 #include "blacklist.h"
+#include "reject.h"
 
 #define DEBUG_EXITED_CLIENTS
 
@@ -1099,7 +1100,7 @@ free_exited_clients(void *unused)
                                                target_p->name, (unsigned int) target_p->status,
                                                target_p->flags, target_p->flags2, target_p->handler);
                                        sendto_realops_snomask(SNO_GENERAL, L_ALL,
-                                               "Please report this to the ratbox developers!");
+                                               "Please report this to the charybdis developers!");
                                        found++;
                                }
                        }
@@ -1284,7 +1285,7 @@ exit_aborted_clients(void *unused)
                                        abt->client->name, (unsigned int) abt->client->status,
                                        abt->client->flags, abt->client->flags2, abt->client->handler);
                                sendto_realops_snomask(SNO_GENERAL, L_ALL,
-                                       "Please report this to the ratbox developers!");
+                                       "Please report this to the charybdis developers!");
                                continue;
                        }
                }
@@ -1419,6 +1420,7 @@ exit_unknown_client(struct Client *client_p, struct Client *source_p, struct Cli
 {
        delete_auth_queries(source_p);
        client_flush_input(source_p);
+       del_unknown_ip(source_p);
        dlinkDelete(&source_p->localClient->tnode, &unknown_list);
 
        if(!IsIOError(source_p))
@@ -1434,7 +1436,6 @@ exit_unknown_client(struct Client *client_p, struct Client *source_p, struct Cli
        del_from_hostname_hash(source_p->host, source_p);
        del_from_client_hash(source_p->name, source_p);
        remove_client_from_list(source_p);
-       free_pre_client(source_p);
        SetDead(source_p);
        dlinkAddAlloc(source_p, &dead_list);
 
@@ -1554,12 +1555,6 @@ exit_local_server(struct Client *client_p, struct Client *source_p, struct Clien
                           source_p->name, comment);
        }
        
-       if(source_p->localClient->ctrlfd >= 0)
-       {
-               comm_close(source_p->localClient->ctrlfd);
-               source_p->localClient->ctrlfd = -1;
-       }
-
        if(source_p->servptr && source_p->servptr->serv)
                dlinkDelete(&source_p->lnode, &source_p->servptr->serv->servers);
        else
@@ -2105,13 +2100,10 @@ close_connection(struct Client *client_p)
                client_p->localClient->fd = -1;
        }
 
-       if(HasServlink(client_p))
+       if(-1 < client_p->localClient->ctrlfd)
        {
-               if(client_p->localClient->fd > -1)
-               {
-                       comm_close(client_p->localClient->ctrlfd);
-                       client_p->localClient->ctrlfd = -1;
-               }
+               comm_close(client_p->localClient->ctrlfd);
+               client_p->localClient->ctrlfd = -1;
        }
 
        linebuf_donebuf(&client_p->localClient->buf_sendq);