1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00

r9293: Fix error path memory leak bug found by Coverity - also potential NULL

deref bug (in unlikely error path) found by Coverity.
Jeremy.
(This used to be commit 9b5cc58f3a)
This commit is contained in:
Jeremy Allison 2005-08-13 01:48:29 +00:00 committed by Gerald (Jerry) Carter
parent 2d4ded54b6
commit baf5fd8336

View File

@ -1548,9 +1548,13 @@ Deny entry after Allow entry. Failing to set on file %s.\n", fsp->fsp_name ));
* entries can be converted to *_OBJ. Usually we will already have these
* entries in the Default ACL, and the Access ACL will not have them.
*/
if (file_ace) {
check_owning_objs(file_ace, pfile_owner_sid, pfile_grp_sid);
}
if (dir_ace) {
check_owning_objs(dir_ace, pfile_owner_sid, pfile_grp_sid);
}
}
*ppfile_ace = file_ace;
*ppdir_ace = dir_ace;
@ -2801,7 +2805,7 @@ size_t get_nt_acl(files_struct *fsp, uint32 security_info, SEC_DESC **ppdesc)
if (count_canon_ace_list(file_ace) == 0) {
DEBUG(0,("get_nt_acl : No ACLs on file (%s) !\n", fsp->fsp_name ));
return 0;
goto done;
}
if (fsp->is_directory && def_acl) {
@ -2950,7 +2954,9 @@ size_t get_nt_acl(files_struct *fsp, uint32 security_info, SEC_DESC **ppdesc)
if(!psd) {
DEBUG(0,("get_nt_acl: Unable to malloc space for security descriptor.\n"));
sd_size = 0;
} else {
goto done;
}
/*
* Windows 2000: The DACL_PROTECTED flag in the security
* descriptor marks the ACL as non-inheriting, i.e., no
@ -2964,19 +2970,21 @@ size_t get_nt_acl(files_struct *fsp, uint32 security_info, SEC_DESC **ppdesc)
if (get_protected_flag(pal) || !lp_map_acl_inherit(SNUM(conn))) {
psd->type |= SE_DESC_DACL_PROTECTED;
}
}
if (psd->dacl)
if (psd->dacl) {
dacl_sort_into_canonical_order(psd->dacl->ace, (unsigned int)psd->dacl->num_aces);
}
*ppdesc = psd;
done:
if (posix_acl)
if (posix_acl) {
SMB_VFS_SYS_ACL_FREE_ACL(conn, posix_acl);
if (def_acl)
}
if (def_acl) {
SMB_VFS_SYS_ACL_FREE_ACL(conn, def_acl);
}
free_canon_ace_list(file_ace);
free_canon_ace_list(dir_ace);
free_inherited_info(pal);