summaryrefslogtreecommitdiff
path: root/source3/modules/vfs_hpuxacl.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-08-12 20:41:35 +1000
committerAndrew Bartlett <abartlet@samba.org>2012-08-15 11:44:43 +1000
commitdcfb6aad16b4b7b70a63340a17771d3f40aed1ce (patch)
tree642350bd8b0e54bdbb24bcd7b712c411eedd3441 /source3/modules/vfs_hpuxacl.c
parent47082ad3fae086c168bfedaa2fba692eccff3145 (diff)
downloadsamba-dcfb6aad16b4b7b70a63340a17771d3f40aed1ce.tar.gz
samba-dcfb6aad16b4b7b70a63340a17771d3f40aed1ce.tar.bz2
samba-dcfb6aad16b4b7b70a63340a17771d3f40aed1ce.zip
s3-smbd: Change allocation of smb_acl_t to talloc()
The acl element is changed to be a talloc child, and is no longer one element longer than requested by virtue of the acl[1] base pointer. This also avoids one of the few remaining cases of over-allocation of a structure. Andrew Bartlett
Diffstat (limited to 'source3/modules/vfs_hpuxacl.c')
-rw-r--r--source3/modules/vfs_hpuxacl.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/source3/modules/vfs_hpuxacl.c b/source3/modules/vfs_hpuxacl.c
index 1b5d8d087d..f8661b1134 100644
--- a/source3/modules/vfs_hpuxacl.c
+++ b/source3/modules/vfs_hpuxacl.c
@@ -386,7 +386,7 @@ int hpuxacl_sys_acl_delete_def_file(vfs_handle_struct *handle,
done:
DEBUG(10, ("hpuxacl_sys_acl_delete_def_file %s.\n",
((ret != 0) ? "failed" : "succeeded" )));
- SAFE_FREE(smb_acl);
+ TALLOC_FREE(smb_acl);
return ret;
}
@@ -506,11 +506,8 @@ static SMB_ACL_T hpux_acl_to_smb_acl(HPUX_ACL_T hpux_acl, int count,
if (!_IS_OF_TYPE(hpux_acl[i], type)) {
continue;
}
- result = SMB_REALLOC(result,
- sizeof(struct smb_acl_t) +
- (sizeof(struct smb_acl_entry) *
- (result->count + 1)));
- if (result == NULL) {
+ result->acl = talloc_realloc(result, result->acl, struct smb_acl_entry, result->count + 1);
+ if (result->acl == NULL) {
DEBUG(10, ("error reallocating memory for SMB_ACL\n"));
goto fail;
}
@@ -534,7 +531,7 @@ static SMB_ACL_T hpux_acl_to_smb_acl(HPUX_ACL_T hpux_acl, int count,
}
goto done;
fail:
- SAFE_FREE(result);
+ TALLOC_FREE(result);
done:
DEBUG(10, ("hpux_acl_to_smb_acl %s\n",
((result == NULL) ? "failed" : "succeeded")));