diff options
Diffstat (limited to 'source4/smbd/process_single.c')
-rw-r--r-- | source4/smbd/process_single.c | 14 |
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) |