summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/smbd/conn.c15
-rw-r--r--source3/smbd/service.c16
2 files changed, 15 insertions, 16 deletions
diff --git a/source3/smbd/conn.c b/source3/smbd/conn.c
index 83289b2184..1dc4ac9e7d 100644
--- a/source3/smbd/conn.c
+++ b/source3/smbd/conn.c
@@ -164,6 +164,21 @@ free a conn structure
****************************************************************************/
void conn_free(connection_struct *conn)
{
+ /* Close dlopen() handle */
+
+ if (conn->vfs_conn->dl_handle != NULL) {
+ dlclose(conn->vfs_conn->dl_handle); /* should we check return val? */
+ }
+
+ /* Free vfs_connection_struct */
+
+ if (conn->vfs_conn != NULL) {
+ if (conn->vfs_conn->groups != NULL) {
+ free(conn->vfs_conn->groups);
+ }
+ free(conn->vfs_conn);
+ }
+
DLIST_REMOVE(Connections, conn);
if (conn->ngroups && conn->groups) {
diff --git a/source3/smbd/service.c b/source3/smbd/service.c
index 8d04ce36e1..8e04f7e989 100644
--- a/source3/smbd/service.c
+++ b/source3/smbd/service.c
@@ -654,21 +654,6 @@ void close_cnum(connection_struct *conn, uint16 vuid)
}
- /* Close dlopen() handle */
-
- if (conn->vfs_conn->dl_handle != NULL) {
- dlclose(conn->vfs_conn->dl_handle); /* should we check return val? */
- }
-
- /* Free vfs_connection_struct */
-
- if (conn->vfs_conn != NULL) {
- if (conn->vfs_conn->groups != NULL) {
- free(conn->vfs_conn->groups);
- }
- free(conn->vfs_conn);
- }
-
yield_connection(conn,
lp_servicename(SNUM(conn)),
lp_max_connections(SNUM(conn)));
@@ -697,6 +682,5 @@ void close_cnum(connection_struct *conn, uint16 vuid)
standard_sub_conn(conn,cmd);
smbrun(cmd,NULL,False);
}
-
conn_free(conn);
}