Attempt to fix SF bug #2874316 by invalidating a file descriptor that the system...
[ircu2.10.12-pk.git] / ircd / list.c
index 21eab14c8ae7c91fa3974b88d73a7656776cad91..f6a11328ffedbc84b6f3f4a65309aa77b6bd9c15 100644 (file)
@@ -165,10 +165,6 @@ static void dealloc_connection(struct Connection* con)
 
   Debug((DEBUG_LIST, "Deallocating connection %p", con));
 
-  if (con_dns_reply(con)) {
-    MyFree(con_dns_reply(con));
-    con_dns_reply(con) = 0;
-  }
   if (-1 < con_fd(con))
     close(con_fd(con));
   MsgQClear(&(con_sendQ(con)));
@@ -223,7 +219,6 @@ struct Client* make_client(struct Client *from, int status)
     cli_connect(cptr) = con; /* set the connection and other fields */
     cli_since(cptr) = cli_lasttime(cptr) = cli_firsttime(cptr) = CurrentTime;
     cli_lastnick(cptr) = TStime();
-    cli_unreg(cptr) = CLIREG_INIT;
   } else
     cli_connect(cptr) = cli_connect(from); /* use 'from's connection */
 
@@ -274,7 +269,7 @@ void free_client(struct Client* cptr)
         cptr, cli_connect(cptr)));
 
   if (cli_auth(cptr))
-    destroy_auth_request(cli_auth(cptr), 0);
+    destroy_auth_request(cli_auth(cptr));
 
   /* Make sure we didn't magically get re-added to the list */
   assert(cli_next(cptr) == 0);
@@ -432,6 +427,9 @@ void verify_client_list(void)
  */
 struct SLink* make_link(void)
 {
+#if 1
+  struct SLink* lp = (struct SLink*) MyMalloc(sizeof(struct SLink));
+#else
   struct SLink* lp = slinkFreeList;
   if (lp)
     slinkFreeList = lp->next;
@@ -439,8 +437,10 @@ struct SLink* make_link(void)
     lp = (struct SLink*) MyMalloc(sizeof(struct SLink));
     links.alloc++;
   }
+#endif
   assert(0 != lp);
   links.inuse++;
+  memset(lp, 0, sizeof(*lp));
   return lp;
 }
 
@@ -450,10 +450,14 @@ struct SLink* make_link(void)
 void free_link(struct SLink* lp)
 {
   if (lp) {
+#if 1
+    MyFree(lp);
+#else
     lp->next = slinkFreeList;
     slinkFreeList = lp;
+#endif
+    links.inuse--;
   }
-  links.inuse--;
 }
 
 /** Add an element to a doubly linked list.