summaryrefslogtreecommitdiff
path: root/source4/smbd
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2005-01-11 15:18:18 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:08:43 -0500
commit9261f6e928bba21436dd3168db6db231e6a4e3ad (patch)
treef8dce8ece64c00490fc6251360f2fb929a35372a /source4/smbd
parent91e9cf6d1a53cc63410e1535907a2ad015e80c82 (diff)
downloadsamba-9261f6e928bba21436dd3168db6db231e6a4e3ad.tar.gz
samba-9261f6e928bba21436dd3168db6db231e6a4e3ad.tar.bz2
samba-9261f6e928bba21436dd3168db6db231e6a4e3ad.zip
r4685: only remove events when we have them
metze (This used to be commit d2276a9149b14aed459e9492384c0a7563dd154c)
Diffstat (limited to 'source4/smbd')
-rw-r--r--source4/smbd/service.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/source4/smbd/service.c b/source4/smbd/service.c
index fac0e175a1..586c05c2c6 100644
--- a/source4/smbd/service.c
+++ b/source4/smbd/service.c
@@ -192,10 +192,14 @@ static int server_destructor(void *ptr)
socket_destroy(conn->socket);
- event_remove_fd(conn->event.ctx, conn->event.fde);
- conn->event.fde = NULL;
- event_remove_timed(conn->event.ctx, conn->event.idle);
- conn->event.idle = NULL;
+ if (conn->event.fde) {
+ event_remove_fd(conn->event.ctx, conn->event.fde);
+ conn->event.fde = NULL;
+ }
+ if (conn->event.idle) {
+ event_remove_timed(conn->event.ctx, conn->event.idle);
+ conn->event.idle = NULL;
+ }
DLIST_REMOVE(conn->server_socket->connection_list, conn);