From 7275952568bbf003299d895b71b246f75851db93 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 19 Oct 2008 10:05:48 +0200 Subject: Add TALLOC_CTX pointer to generate_random_str(), for consistency with Samba 4. --- source3/libsmb/trusts_util.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source3/libsmb') diff --git a/source3/libsmb/trusts_util.c b/source3/libsmb/trusts_util.c index 2f336f14e6..f0595695d2 100644 --- a/source3/libsmb/trusts_util.c +++ b/source3/libsmb/trusts_util.c @@ -33,13 +33,12 @@ NTSTATUS trust_pw_change_and_store_it(struct rpc_pipe_client *cli, TALLOC_CTX *m { unsigned char new_trust_passwd_hash[16]; char *new_trust_passwd; - char *str; NTSTATUS nt_status; /* Create a random machine account password */ - str = generate_random_str(DEFAULT_TRUST_ACCOUNT_PASSWORD_LENGTH); + new_trust_passwd = generate_random_str(mem_ctx, DEFAULT_TRUST_ACCOUNT_PASSWORD_LENGTH); - if ((new_trust_passwd = talloc_strdup(mem_ctx, str)) == NULL) { + if (new_trust_passwd == NULL) { DEBUG(0, ("talloc_strdup failed\n")); return NT_STATUS_NO_MEMORY; } -- cgit