From 9ffa6d49a56f9a55ad34f4c687429c8fd14e9d8c Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 10 Dec 2018 12:34:13 +0100 Subject: libgpo: Use dom_sid_str_buf Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- libgpo/gpo_reg.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'libgpo') diff --git a/libgpo/gpo_reg.c b/libgpo/gpo_reg.c index 644b4d36d62..a160c3dd03d 100644 --- a/libgpo/gpo_reg.c +++ b/libgpo/gpo_reg.c @@ -351,7 +351,6 @@ static WERROR gp_reg_store_groupmembership(TALLOC_CTX *mem_ctx, uint32_t i = 0; const char *valname = NULL; const char *path = NULL; - const char *val = NULL; int count = 0; path = gp_reg_groupmembership_path(mem_ctx, &token->sids[0], @@ -365,13 +364,16 @@ static WERROR gp_reg_store_groupmembership(TALLOC_CTX *mem_ctx, W_ERROR_NOT_OK_RETURN(werr); for (i=0; inum_sids; i++) { + struct dom_sid_buf buf; valname = talloc_asprintf(mem_ctx, "Group%d", count++); W_ERROR_HAVE_NO_MEMORY(valname); - val = sid_string_talloc(mem_ctx, &token->sids[i]); - W_ERROR_HAVE_NO_MEMORY(val); - werr = gp_store_reg_val_sz(mem_ctx, key, valname, val); + werr = gp_store_reg_val_sz( + mem_ctx, + key, + valname, + dom_sid_str_buf(&token->sids[i], &buf)); W_ERROR_NOT_OK_RETURN(werr); } -- cgit v1.2.1