From 6e6374cb5bcffb4df8bdb0a83327fff92b61ac84 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 3 Dec 2004 07:20:30 +0000 Subject: r4055: fixed more places to use type safe allocation macros (This used to be commit eec698254f67365f27b4b7569fa982e22472aca1) --- source4/auth/pampass.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source4/auth') diff --git a/source4/auth/pampass.c b/source4/auth/pampass.c index a5c9a5de16..8612aa9ac0 100644 --- a/source4/auth/pampass.c +++ b/source4/auth/pampass.c @@ -130,7 +130,7 @@ static int smb_pam_conv(int num_msg, return PAM_CONV_ERR; } - reply = malloc(sizeof(struct pam_response) * num_msg); + reply = malloc_array_p(struct pam_response, num_msg); if (!reply) return PAM_CONV_ERR; @@ -210,7 +210,7 @@ static struct chat_struct *make_pw_chat(char *p) struct chat_struct *t; while (1) { - t = (struct chat_struct *)malloc(sizeof(*t)); + t = malloc_p(struct chat_struct); if (!t) { DEBUG(0,("make_pw_chat: malloc failed!\n")); return NULL; @@ -289,7 +289,7 @@ static int smb_pam_passchange_conv(int num_msg, return PAM_CONV_ERR; } - reply = malloc(sizeof(struct pam_response) * num_msg); + reply = malloc_array_p(struct pam_response, num_msg); if (!reply) { DEBUG(0,("smb_pam_passchange_conv: malloc for reply failed!\n")); free_pw_chat(pw_chat); @@ -405,8 +405,8 @@ static void smb_free_pam_conv(struct pam_conv *pconv) static struct pam_conv *smb_setup_pam_conv(smb_pam_conv_fn smb_pam_conv_fnptr, const char *user, const char *passwd, const char *newpass) { - struct pam_conv *pconv = (struct pam_conv *)malloc(sizeof(struct pam_conv)); - struct smb_pam_userdata *udp = (struct smb_pam_userdata *)malloc(sizeof(struct smb_pam_userdata)); + struct pam_conv *pconv = malloc_p(struct pam_conv); + struct smb_pam_userdata *udp = malloc_p(struct smb_pam_userdata); if (pconv == NULL || udp == NULL) { SAFE_FREE(pconv); -- cgit