Avoid an else with implicit NULL initialization
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
return NULL;
}
- cpy->uid = tok->uid;
- cpy->gid = tok->gid;
- cpy->ngroups = tok->ngroups;
+ *cpy = (struct security_unix_token){
+ .uid = tok->uid,
+ .gid = tok->gid,
+ .ngroups = tok->ngroups,
+ };
+
if (tok->ngroups) {
/* Make this a talloc child of cpy. */
cpy->groups = (gid_t *)talloc_memdup(
TALLOC_FREE(cpy);
return NULL;
}
- } else {
- cpy->groups = NULL;
}
return cpy;
}