summaryrefslogtreecommitdiff
path: root/source4/smbd/process_single.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2004-07-15 09:43:32 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:57:38 -0500
commit7a0e61f38ea6b13f1f45e89f6f160d6c32f08617 (patch)
treef23d46549ac59b97ecd78fec2f4747c2c4c737dc /source4/smbd/process_single.c
parentb11e1a41d8bc30d1849e95bf47b84a081570bd07 (diff)
downloadsamba-7a0e61f38ea6b13f1f45e89f6f160d6c32f08617.tar.gz
samba-7a0e61f38ea6b13f1f45e89f6f160d6c32f08617.tar.bz2
samba-7a0e61f38ea6b13f1f45e89f6f160d6c32f08617.zip
r1516: remove the server_connection from the list on the server_socket
and call talloc_destroy(srv_conn->mem_ctx) also don't follow NULL pointers metze (This used to be commit 786c00c3d4f510c870a45f11af69281298ba176d)
Diffstat (limited to 'source4/smbd/process_single.c')
-rw-r--r--source4/smbd/process_single.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/source4/smbd/process_single.c b/source4/smbd/process_single.c
index 554f3e91da..8bd00c53b9 100644
--- a/source4/smbd/process_single.c
+++ b/source4/smbd/process_single.c
@@ -68,8 +68,18 @@ static void single_accept_connection(struct event_context *ev, struct fd_event *
static void single_terminate_connection(struct server_connection *conn, const char *reason)
{
DEBUG(0,("single_terminate_connection: reason[%s]\n",reason));
- conn->service->ops->close_connection(conn,reason);
- server_destroy_connection(conn);
+
+ if (conn) {
+ if (conn->service) {
+ conn->service->ops->close_connection(conn,reason);
+ }
+
+ if (conn->server_socket) {
+ DLIST_REMOVE(conn->server_socket->connection_list,conn);
+ }
+
+ server_destroy_connection(conn);
+ }
}
static int single_get_id(struct smbsrv_request *req)