From: Andrew Bartlett Date: Tue, 19 Sep 2023 21:36:43 +0000 (+1200) Subject: Make blob->data pointer in ace_sid_to_claim_v1_sid() a child of the DATA_BLOB X-Git-Tag: tevent-0.16.0~413 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fe835fc348284f388446514ee5acc479bd36900d;p=thirdparty%2Fsamba.git Make blob->data pointer in ace_sid_to_claim_v1_sid() a child of the DATA_BLOB Signed-off-by: Andrew Bartlett Reviewed-by: Douglas Bagnall --- diff --git a/libcli/security/claims-conversions.c b/libcli/security/claims-conversions.c index 9bb09c01360..d544187102e 100644 --- a/libcli/security/claims-conversions.c +++ b/libcli/security/claims-conversions.c @@ -364,14 +364,16 @@ static bool ace_sid_to_claim_v1_sid(TALLOC_CTX *mem_ctx, size_t offset) { /* claim_v1 sid is an "S-1-*" string data blob, not struct dom_sid. */ + char *s = NULL; + DATA_BLOB *blob = NULL; - char *s = dom_sid_string(mem_ctx, &tok->data.sid.sid); - if (s == NULL) { - return false; - } blob = talloc(mem_ctx, DATA_BLOB); if (blob == NULL) { - TALLOC_FREE(s); + return false; + } + s = dom_sid_string(blob, &tok->data.sid.sid); + if (s == NULL) { + TALLOC_FREE(blob); return false; } *blob = data_blob_string_const(s); @@ -390,7 +392,7 @@ static bool ace_octet_string_to_claim_v1_octet_string( return false; } - *v = data_blob_talloc(mem_ctx, + *v = data_blob_talloc(v, tok->data.bytes.data, tok->data.bytes.length); if (v->data == NULL) {