smbd: Always free the talloc_stackframe() before leaving smbd_do_query_security_desc
authorAndrew Bartlett <abartlet@samba.org>
Thu, 11 Oct 2012 11:29:43 +0000 (22:29 +1100)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 11 Oct 2012 13:20:54 +0000 (15:20 +0200)
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Oct 11 15:20:54 CEST 2012 on sn-devel-104

source3/smbd/nttrans.c

index 1011bd7025dc6c072ad706c7c2ef6ba02f1be19b..f5e5877d0937d45829b5bd59413cb78c0944a789 100644 (file)
@@ -1916,12 +1916,14 @@ NTSTATUS smbd_do_query_security_desc(connection_struct *conn,
        if ((security_info_wanted & SECINFO_SACL) &&
                        !(fsp->access_mask & SEC_FLAG_SYSTEM_SECURITY)) {
                DEBUG(10, ("Access to SACL denied.\n"));
+               TALLOC_FREE(frame);
                return NT_STATUS_ACCESS_DENIED;
        }
 
        if ((security_info_wanted & (SECINFO_DACL|SECINFO_OWNER|SECINFO_GROUP)) &&
                        !(fsp->access_mask & SEC_STD_READ_CONTROL)) {
                DEBUG(10, ("Access to DACL, OWNER, or GROUP denied.\n"));
+               TALLOC_FREE(frame);
                return NT_STATUS_ACCESS_DENIED;
        }
 
@@ -1942,6 +1944,7 @@ NTSTATUS smbd_do_query_security_desc(connection_struct *conn,
                        fsp, security_info_wanted, frame, &psd);
        }
        if (!NT_STATUS_IS_OK(status)) {
+               TALLOC_FREE(frame);
                return status;
        }