From: Volker Lendecke Date: Thu, 14 Nov 2024 19:48:14 +0000 (+0100) Subject: smbpasswd4: Simplify smbpasswd_sethexpwd() X-Git-Tag: tdb-1.4.13~505 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5aa0cb0ea490a426dd9e8a581ee408d7f3a35340;p=thirdparty%2Fsamba.git smbpasswd4: Simplify smbpasswd_sethexpwd() Signed-off-by: Volker Lendecke Reviewed-by: Ralph Boehme --- diff --git a/source4/lib/samba3/smbpasswd.c b/source4/lib/samba3/smbpasswd.c index 6f4d832ae2b..d0b7e9dbd48 100644 --- a/source4/lib/samba3/smbpasswd.c +++ b/source4/lib/samba3/smbpasswd.c @@ -89,11 +89,7 @@ char *smbpasswd_sethexpwd(TALLOC_CTX *mem_ctx, struct samr_Password *pwd, uint16 { char *p; if (pwd != NULL) { - p = talloc_array(mem_ctx, char, 33); - if (!p) { - return NULL; - } - hex_encode_buf(p, pwd->hash, sizeof(pwd->hash)); + p = hex_encode_talloc(mem_ctx, pwd->hash, sizeof(pwd->hash)); } else { if (acb_info & ACB_PWNOTREQ) p = talloc_strdup(mem_ctx, "NO PASSWORDXXXXXXXXXXXXXXXXXXXXX");