s3: Make use of talloc_array in pdb_set_plaintext_passwd()
authorVolker Lendecke <vl@samba.org>
Mon, 14 Dec 2009 17:39:19 +0000 (18:39 +0100)
committerMichael Adam <obnox@samba.org>
Thu, 7 Jan 2010 10:07:53 +0000 (11:07 +0100)
source3/passdb/pdb_get_set.c

index af99e8110cbdfa7fd7a4caeea61b3ca67c9eb511..bea4c3278e00ba1e433828272a7f5734dc7f897c 100644 (file)
@@ -1051,8 +1051,9 @@ bool pdb_set_plaintext_passwd(struct samu *sampass, const char *plaintext)
                        /*
                         * Ensure we have space for the needed history.
                         */
-                       uchar *new_history = (uchar *)TALLOC(
-                               sampass, pwHistLen*PW_HISTORY_ENTRY_LEN);
+                       uchar *new_history = talloc_array(
+                               sampass, uchar,
+                               pwHistLen*PW_HISTORY_ENTRY_LEN);
                        if (!new_history) {
                                return False;
                        }