Author: tridge
Date: 2007-02-07 07:06:28 +0000 (Wed, 07 Feb 2007)
New Revision: 21214

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=21214

Log:

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

Modified:
   branches/SAMBA_4_0/source/ntvfs/unixuid/vfs_unixuid.c


Changeset:
Modified: branches/SAMBA_4_0/source/ntvfs/unixuid/vfs_unixuid.c
===================================================================
--- branches/SAMBA_4_0/source/ntvfs/unixuid/vfs_unixuid.c       2007-02-07 
03:21:56 UTC (rev 21213)
+++ branches/SAMBA_4_0/source/ntvfs/unixuid/vfs_unixuid.c       2007-02-07 
07:06:28 UTC (rev 21214)
@@ -156,7 +156,7 @@
 
        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 @@
        } 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 @@
 
        status = set_unix_security(newsec);
        if (!NT_STATUS_IS_OK(status)) {
+               talloc_free(*sec);
                return status;
        }
 
@@ -194,6 +196,7 @@
        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)
 

Reply via email to