mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
libcli/security: avoid leak on SDDL encode failure
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
parent
4f56c70283
commit
e338625ebf
@ -1289,7 +1289,10 @@ char *sddl_encode(TALLOC_CTX *mem_ctx, const struct security_descriptor *sd,
|
||||
sddl = talloc_strdup(mem_ctx, "");
|
||||
if (sddl == NULL) goto failed;
|
||||
|
||||
tmp_ctx = talloc_new(mem_ctx);
|
||||
tmp_ctx = talloc_new(sddl);
|
||||
if (tmp_ctx == NULL) {
|
||||
goto failed;
|
||||
}
|
||||
|
||||
if (sd->owner_sid != NULL) {
|
||||
char *sid = sddl_transition_encode_sid(tmp_ctx, sd->owner_sid, &state);
|
||||
|
Loading…
Reference in New Issue
Block a user