diff options
author | Andrew Tridgell <tridge@samba.org> | 2007-02-07 07:06:28 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:44:47 -0500 |
commit | 667cff3699a37510a69f682407bdda6316ba4402 (patch) | |
tree | 30aa8794e85422b676f06099ba16941059b5f044 | |
parent | 80445f7596af353285a51d01e50d36037a6a6107 (diff) | |
download | samba-667cff3699a37510a69f682407bdda6316ba4402.tar.gz samba-667cff3699a37510a69f682407bdda6316ba4402.tar.bz2 samba-667cff3699a37510a69f682407bdda6316ba4402.zip |
r21214: fixed a valgrind error that can be caused by a semi-async call inside
a nested ntvfs call. The req structure can go away while processing a
ntvfs request
(This used to be commit f62b3c505f71f37a86a76d152d643926e19eb148)
-rw-r--r-- | source4/ntvfs/unixuid/vfs_unixuid.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source4/ntvfs/unixuid/vfs_unixuid.c b/source4/ntvfs/unixuid/vfs_unixuid.c index 17fdb42de0..b430d3048b 100644 --- a/source4/ntvfs/unixuid/vfs_unixuid.c +++ b/source4/ntvfs/unixuid/vfs_unixuid.c @@ -156,7 +156,7 @@ static NTSTATUS unixuid_setup_security(struct ntvfs_module_context *ntvfs, token = req->session_info->security_token; - *sec = save_unix_security(req); + *sec = save_unix_security(ntvfs); if (*sec == NULL) { return NT_STATUS_NO_MEMORY; } @@ -166,6 +166,7 @@ static NTSTATUS unixuid_setup_security(struct ntvfs_module_context *ntvfs, } else { status = nt_token_to_unix_security(ntvfs, req, token, &newsec); if (!NT_STATUS_IS_OK(status)) { + talloc_free(*sec); return status; } if (private->last_sec_ctx) { @@ -178,6 +179,7 @@ static NTSTATUS unixuid_setup_security(struct ntvfs_module_context *ntvfs, status = set_unix_security(newsec); if (!NT_STATUS_IS_OK(status)) { + talloc_free(*sec); return status; } @@ -194,6 +196,7 @@ static NTSTATUS unixuid_setup_security(struct ntvfs_module_context *ntvfs, NT_STATUS_NOT_OK_RETURN(status); \ status = ntvfs_next_##op args; \ status2 = set_unix_security(sec); \ + talloc_free(sec); \ if (!NT_STATUS_IS_OK(status2)) smb_panic("Unable to reset security context"); \ } while (0) |