summaryrefslogtreecommitdiffstats
path: root/auth-pam.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2007-05-20 07:20:08 +0200
committerDarren Tucker <dtucker@zip.com.au>2007-05-20 07:20:08 +0200
commit29171e9f5c094d912bd27c60b2973617e05cc785 (patch)
treee22d06c2e77bc494af8614871c6f87cd9a3ed50e /auth-pam.c
parent - jolan@cvs.openbsd.org 2007/05/17 23:53:41 (diff)
downloadopenssh-29171e9f5c094d912bd27c60b2973617e05cc785.tar.xz
openssh-29171e9f5c094d912bd27c60b2973617e05cc785.zip
- (dtucker) [auth-pam.c] malloc+memset -> calloc. Patch from
ldv at altlinux.org.
Diffstat (limited to '')
-rw-r--r--auth-pam.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/auth-pam.c b/auth-pam.c
index c08d47229..bfd8f3270 100644
--- a/auth-pam.c
+++ b/auth-pam.c
@@ -686,8 +686,7 @@ sshpam_init_ctx(Authctxt *authctxt)
return (NULL);
}
- ctxt = xmalloc(sizeof *ctxt);
- memset(ctxt, 0, sizeof(*ctxt));
+ ctxt = xcalloc(1, sizeof *ctxt);
/* Start the authentication thread */
if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, socks) == -1) {
@@ -1130,9 +1129,8 @@ sshpam_passwd_conv(int n, sshpam_const struct pam_message **msg,
if (n <= 0 || n > PAM_MAX_NUM_MSG)
return (PAM_CONV_ERR);
- if ((reply = malloc(n * sizeof(*reply))) == NULL)
+ if ((reply = calloc(n, sizeof(*reply))) == NULL)
return (PAM_CONV_ERR);
- memset(reply, 0, n * sizeof(*reply));
for (i = 0; i < n; ++i) {
switch (PAM_MSG_MEMBER(msg, i, msg_style)) {