1
0
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:
Douglas Bagnall 2023-11-17 12:01:15 +13:00 committed by Andrew Bartlett
parent 4f56c70283
commit e338625ebf

View File

@ -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);