From df98bc52c8517e19c8afc80d456a6603e2709086 Mon Sep 17 00:00:00 2001 From: jilles Date: Mon, 5 Mar 2007 09:41:40 -0800 Subject: [PATCH] [svn] Don't reference freed memory (fde_t) in comm_close(). --- ChangeLog | 9 +++++++++ include/serno.h | 2 +- libcharybdis/commio.c | 4 ++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index ed39c079d..00992216b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +nenolod 2007/03/05 17:35:17 UTC (20070305-3237) + Log: + - fix for 100% cpu use + + + Changes: Modified: + +1 -1 trunk/libcharybdis/commio.c (File Modified) + + nenolod 2007/03/05 17:31:35 UTC (20070305-3235) Log: - rework comm_checktimeouts() to use the hashtable in an efficient manner. diff --git a/include/serno.h b/include/serno.h index b5d4f38d1..24cb0bee4 100644 --- a/include/serno.h +++ b/include/serno.h @@ -1 +1 @@ -#define SERNO "20070305-3235" +#define SERNO "20070305-3237" diff --git a/libcharybdis/commio.c b/libcharybdis/commio.c index 4b397e1e6..4dc50201e 100644 --- a/libcharybdis/commio.c +++ b/libcharybdis/commio.c @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * - * $Id: commio.c 3237 2007-03-05 17:35:17Z nenolod $ + * $Id: commio.c 3239 2007-03-05 17:41:40Z jilles $ */ #include "libcharybdis.h" @@ -801,6 +801,7 @@ comm_close(int fd) } comm_setselect(F->fd, FDLIST_NONE, COMM_SELECT_WRITE | COMM_SELECT_READ, NULL, NULL, 0); comm_setflush(F->fd, 0, NULL, NULL); + F->timeout = 0; if (F->dns_query != NULL) { @@ -814,7 +815,6 @@ comm_close(int fd) number_fd--; comm_remove_fd(fd); - F->timeout = 0; /* Unlike squid, we're actually closing the FD here! -- adrian */ close(fd); }