[PATCH] passdb: Use talloc_zero_array

Volker Lendecke Volker.Lendecke at SerNet.DE
Fri Sep 19 18:32:45 MDT 2014


Hi!

Review&push would be appreciated.

Thanks,

Volker

-- 
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:kontakt at sernet.de
-------------- next part --------------
From 1490145997c81d584743ad046f932a501bbb529a Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vl at samba.org>
Date: Sat, 20 Sep 2014 02:08:44 +0200
Subject: [PATCH] passdb: Use talloc_zero_array

Signed-off-by: Volker Lendecke <vl at samba.org>
---
 source3/passdb/pdb_ldap.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c
index 7dccc03..0458e56 100644
--- a/source3/passdb/pdb_ldap.c
+++ b/source3/passdb/pdb_ldap.c
@@ -855,13 +855,12 @@ static bool init_sam_from_ldap(struct ldapsam_privates *ldap_state,
 
 		pwHistLen = MIN(pwHistLen, MAX_PW_HISTORY_LEN);
 
-		pwhist = talloc_array(ctx, uint8,
-				      pwHistLen * PW_HISTORY_ENTRY_LEN);
+		pwhist = talloc_zero_array(ctx, uint8,
+					   pwHistLen * PW_HISTORY_ENTRY_LEN);
 		if (pwhist == NULL) {
 			DEBUG(0, ("init_sam_from_ldap: talloc failed!\n"));
 			goto fn_exit;
 		}
-		memset(pwhist, '\0', pwHistLen * PW_HISTORY_ENTRY_LEN);
 
 		if (smbldap_get_single_attribute(
 				ldap_state->smbldap_state->ldap_struct,
-- 
1.7.9.5



More information about the samba-technical mailing list