summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-02-28 06:41:07 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:10:52 -0500
commit99b74908cd064d7e1a3864db9c6b7dba018577c3 (patch)
treeab91b5859539c82b36166953f09ed03c04e8f66a
parentddf14cc286944e11cebfcf550cf57a7a9436a5a0 (diff)
downloadsamba-99b74908cd064d7e1a3864db9c6b7dba018577c3.tar.gz
samba-99b74908cd064d7e1a3864db9c6b7dba018577c3.tar.bz2
samba-99b74908cd064d7e1a3864db9c6b7dba018577c3.zip
r13748: Don't reference memory after we just freed it (Doh!).
Thanks to tridge's changes to the directory delete on close tests for catching this. Jeremy. (This used to be commit 01ef957d4846191071f95393e6e76e48d4c6aa24)
-rw-r--r--source3/smbd/close.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source3/smbd/close.c b/source3/smbd/close.c
index 09276cd200..bc1182032d 100644
--- a/source3/smbd/close.c
+++ b/source3/smbd/close.c
@@ -363,8 +363,6 @@ static int close_directory(files_struct *fsp, enum file_close_type close_type)
delete_dir = (lck->delete_on_close | lck->initial_delete_on_close);
- TALLOC_FREE(lck);
-
if ((close_type == NORMAL_CLOSE || close_type == SHUTDOWN_CLOSE) &&
delete_dir &&
lck->delete_token) {
@@ -382,6 +380,8 @@ static int close_directory(files_struct *fsp, enum file_close_type close_type)
lck->delete_token->groups,
NULL);
+ TALLOC_FREE(lck);
+
ok = rmdir_internals(fsp->conn, fsp->fsp_name);
DEBUG(5,("close_directory: %s. Delete on close was set - deleting directory %s.\n",
@@ -402,6 +402,7 @@ static int close_directory(files_struct *fsp, enum file_close_type close_type)
}
process_pending_change_notify_queue((time_t)0);
} else {
+ TALLOC_FREE(lck);
remove_pending_change_notify_requests_by_fid(fsp, NT_STATUS_CANCELLED);
}