s3:modules:nfs4_acls fix memory hierarchy in smb_create_smb4acl
authorChristian Ambach <ambi@samba.org>
Mon, 5 Nov 2012 17:47:01 +0000 (18:47 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 16 Nov 2012 22:28:21 +0000 (23:28 +0100)
the ACEs should be talloc children of the ACL itself and not be placed on talloc_tos()

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source3/modules/nfs4_acls.c

index 48b045feb0e9deebb74386a19980c4642830b95b..1b691c3b5f42b5535f9eb2952eb1855581888314 100644 (file)
@@ -161,11 +161,10 @@ SMB4ACL_T *smb_create_smb4acl(void)
 SMB4ACE_T *smb_add_ace4(SMB4ACL_T *theacl, SMB_ACE4PROP_T *prop)
 {
        SMB_ACL4_INT_T *aclint = get_validated_aclint(theacl);
-       TALLOC_CTX *mem_ctx = talloc_tos();
        SMB_ACE4_INT_T *ace;
 
        ace = (SMB_ACE4_INT_T *)TALLOC_ZERO_SIZE(
-               mem_ctx, sizeof(SMB_ACE4_INT_T));
+               theacl, sizeof(SMB_ACE4_INT_T));
        if (ace==NULL)
        {
                DEBUG(0, ("TALLOC_SIZE failed\n"));