summaryrefslogtreecommitdiffstats
path: root/source/passdb/passdb.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/passdb/passdb.c')
-rw-r--r--source/passdb/passdb.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/passdb/passdb.c b/source/passdb/passdb.c
index 35317b98164..aeea4316f38 100644
--- a/source/passdb/passdb.c
+++ b/source/passdb/passdb.c
@@ -133,7 +133,7 @@ NTSTATUS pdb_init_sam_talloc(TALLOC_CTX *mem_ctx, SAM_ACCOUNT **user)
return NT_STATUS_UNSUCCESSFUL;
}
- *user=(SAM_ACCOUNT *)talloc(mem_ctx, sizeof(SAM_ACCOUNT));
+ *user=TALLOC_P(mem_ctx, SAM_ACCOUNT);
if (*user==NULL) {
DEBUG(0,("pdb_init_sam_talloc: error while allocating memory\n"));
@@ -1893,7 +1893,7 @@ BOOL init_sam_from_buffer_v2(SAM_ACCOUNT *sampass, uint8 *buf, uint32 buflen)
/* Change from V1 is addition of password history field. */
account_policy_get(AP_PASSWORD_HISTORY, &pwHistLen);
if (pwHistLen) {
- char *pw_hist = malloc(pwHistLen * PW_HISTORY_ENTRY_LEN);
+ char *pw_hist = SMB_MALLOC(pwHistLen * PW_HISTORY_ENTRY_LEN);
if (!pw_hist) {
ret = False;
goto done;
@@ -2172,7 +2172,7 @@ uint32 init_buffer_from_sam_v2 (uint8 **buf, const SAM_ACCOUNT *sampass, BOOL si
}
/* malloc the space needed */
- if ( (*buf=(uint8*)malloc(len)) == NULL) {
+ if ( (*buf=(uint8*)SMB_MALLOC(len)) == NULL) {
DEBUG(0,("init_buffer_from_sam_v2: Unable to malloc() memory for buffer!\n"));
return (-1);
}