diff options
author | Gerald Carter <jerry@samba.org> | 2005-05-31 01:44:44 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 10:57:01 -0500 |
commit | a3f4c365171097eaa615b390d74a90b9345a3973 (patch) | |
tree | 002fe223ec07f5013d316ba28f2f0a66f3279e53 /source3/pam_smbpass | |
parent | eb8b02104ecec92063377b156f44a838af944cef (diff) | |
download | samba-a3f4c365171097eaa615b390d74a90b9345a3973.tar.gz samba-a3f4c365171097eaa615b390d74a90b9345a3973.tar.bz2 samba-a3f4c365171097eaa615b390d74a90b9345a3973.zip |
r7126: fixing paranoid malloc checker failures
(This used to be commit b01026674fddb4179a7f002c13f5e341eaaa0a1c)
Diffstat (limited to 'source3/pam_smbpass')
-rw-r--r-- | source3/pam_smbpass/pam_smb_auth.c | 2 | ||||
-rw-r--r-- | source3/pam_smbpass/pam_smb_passwd.c | 2 | ||||
-rw-r--r-- | source3/pam_smbpass/support.c | 7 |
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) { |