mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
libcli:security: Return early if there are no aces to duplicate
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Wed Dec 12 22:18:52 CET 2018 on sn-devel-144
This commit is contained in:
parent
e7a8e4e643
commit
9c507e98f0
@ -67,14 +67,19 @@ struct security_acl *security_acl_dup(TALLOC_CTX *mem_ctx,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
nacl->aces = (struct security_ace *)talloc_memdup (nacl, oacl->aces, sizeof(struct security_ace) * oacl->num_aces);
|
||||
if ((nacl->aces == NULL) && (oacl->num_aces > 0)) {
|
||||
goto failed;
|
||||
*nacl = (struct security_acl) {
|
||||
.revision = oacl->revision,
|
||||
.size = oacl->size,
|
||||
.num_aces = oacl->num_aces,
|
||||
};
|
||||
if (nacl->num_aces == 0) {
|
||||
return nacl;
|
||||
}
|
||||
|
||||
nacl->revision = oacl->revision;
|
||||
nacl->size = oacl->size;
|
||||
nacl->num_aces = oacl->num_aces;
|
||||
nacl->aces = (struct security_ace *)talloc_memdup (nacl, oacl->aces, sizeof(struct security_ace) * oacl->num_aces);
|
||||
if (nacl->aces == NULL) {
|
||||
goto failed;
|
||||
}
|
||||
|
||||
return nacl;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user