From ccdf4e045f6275c58fbb9001119f2b4abf7845bf Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Thu, 23 Sep 2004 00:10:40 +0000 Subject: r2547: Another place to use convert_string_talloc(). Andrew Bartlett (This used to be commit 4904d814c0efd870ac42c790028a8448984e4749) --- source4/torture/rpc/samr.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/source4/torture/rpc/samr.c b/source4/torture/rpc/samr.c index e271f89ae06..5a9462a92a4 100644 --- a/source4/torture/rpc/samr.c +++ b/source4/torture/rpc/samr.c @@ -355,7 +355,7 @@ static BOOL test_SetUserPass(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, encode_pw_buffer(u.info24.password.data, newpass, STR_UNICODE); /* w2k3 ignores this length */ - u.info24.pw_len = str_charnum(newpass)*2; + u.info24.pw_len = strlen_m(newpass) * 2; status = dcerpc_fetch_session_key(p, &session_key); if (!NT_STATUS_IS_OK(status)) { @@ -2424,12 +2424,10 @@ static BOOL test_GroupList(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, /* Querydisplayinfo returns ascii -- convert */ - namelen = convert_string_allocate(CH_DISPLAY, CH_UNIX, - q2.out.info.info5.entries[i].account_name.name, - q2.out.info.info5.entries[i].account_name.name_len, - (void **)&name); - name = realloc(name, namelen+1); - name[namelen] = 0; + namelen = convert_string_talloc(mem_ctx, CH_DISPLAY, CH_UNIX, + q2.out.info.info5.entries[i].account_name.name, + q2.out.info.info5.entries[i].account_name.name_len, + (void **)&name); for (j=0; j