summaryrefslogtreecommitdiff
path: root/source3/pam_smbpass
diff options
context:
space:
mode:
Diffstat (limited to 'source3/pam_smbpass')
-rw-r--r--source3/pam_smbpass/pam_smb_auth.c2
-rw-r--r--source3/pam_smbpass/pam_smb_passwd.c2
-rw-r--r--source3/pam_smbpass/support.c7
3 files changed, 5 insertions, 6 deletions
diff --git a/source3/pam_smbpass/pam_smb_auth.c b/source3/pam_smbpass/pam_smb_auth.c
index d0dca6fa92..74645564d4 100644
--- a/source3/pam_smbpass/pam_smb_auth.c
+++ b/source3/pam_smbpass/pam_smb_auth.c
@@ -82,7 +82,7 @@ int pam_sm_authenticate(pam_handle_t *pamh, int flags,
/* Get a few bytes so we can pass our return value to
pam_sm_setcred(). */
- ret_data = malloc(sizeof(int));
+ ret_data = SMB_MALLOC_P(int);
/* get the username */
retval = pam_get_user( pamh, &name, "Username: " );
diff --git a/source3/pam_smbpass/pam_smb_passwd.c b/source3/pam_smbpass/pam_smb_passwd.c
index bef587a916..8149bc1200 100644
--- a/source3/pam_smbpass/pam_smb_passwd.c
+++ b/source3/pam_smbpass/pam_smb_passwd.c
@@ -169,7 +169,7 @@ int pam_sm_chauthtok(pam_handle_t *pamh, int flags,
/* tell user what is happening */
#define greeting "Changing password for "
- Announce = (char *) malloc(sizeof(greeting)+strlen(user));
+ Announce = SMB_MALLOC_ARRAY(char, sizeof(greeting)+strlen(user));
if (Announce == NULL) {
_log_err(LOG_CRIT, "password: out of memory");
pdb_free_sam(&sampass);
diff --git a/source3/pam_smbpass/support.c b/source3/pam_smbpass/support.c
index 8a0432c855..f5682480eb 100644
--- a/source3/pam_smbpass/support.c
+++ b/source3/pam_smbpass/support.c
@@ -238,7 +238,7 @@ char * smbpXstrDup( const char *x )
register int i;
for (i = 0; x[i]; ++i); /* length of string */
- if ((new = malloc(++i)) == NULL) {
+ if ((new = SMB_MALLOC_ARRAY(char, ++i)) == NULL) {
i = 0;
_log_err( LOG_CRIT, "out of memory in smbpXstrDup" );
} else {
@@ -344,7 +344,7 @@ int _smb_verify_password( pam_handle_t * pamh, SAM_ACCOUNT *sampass,
}
}
- data_name = (char *) malloc( sizeof(FAIL_PREFIX) + strlen( name ));
+ data_name = SMB_MALLOC_ARRAY(char, sizeof(FAIL_PREFIX) + strlen( name ));
if (data_name == NULL) {
_log_err( LOG_CRIT, "no memory for data-name" );
}
@@ -379,8 +379,7 @@ int _smb_verify_password( pam_handle_t * pamh, SAM_ACCOUNT *sampass,
/* get a failure recorder */
- new = (struct _pam_failed_auth *)
- malloc( sizeof(struct _pam_failed_auth) );
+ new = SMB_MALLOC_P( struct _pam_failed_auth );
if (new != NULL) {