table = tcon->table;
tcon->table = NULL;
+ if (tcon->compat) {
+ bool ok;
+
+ ok = chdir_current_service(tcon->compat);
+ if (!ok) {
+ status = NT_STATUS_INTERNAL_ERROR;
+ DEBUG(0, ("smbXsrv_tcon_disconnect(0x%08x, '%s'): "
+ "chdir_current_service() failed: %s\n",
+ tcon->global->tcon_global_id,
+ tcon->global->share_name,
+ nt_errstr(status)));
+ tcon->compat = NULL;
+ return status;
+ }
+
+ close_cnum(tcon->compat, vuid);
+ tcon->compat = NULL;
+ }
+
tcon->status = NT_STATUS_NETWORK_NAME_DELETED;
global_rec = tcon->global->db_rec;
}
tcon->db_rec = NULL;
- if (tcon->compat) {
- bool ok;
-
- ok = chdir_current_service(tcon->compat);
- if (!ok) {
- status = NT_STATUS_INTERNAL_ERROR;
- DEBUG(0, ("smbXsrv_tcon_disconnect(0x%08x, '%s'): "
- "chdir_current_service() failed: %s\n",
- tcon->global->tcon_global_id,
- tcon->global->share_name,
- nt_errstr(status)));
- tcon->compat = NULL;
- return status;
- }
-
- close_cnum(tcon->compat, vuid);
- tcon->compat = NULL;
- }
-
return error;
}