aboutsummaryrefslogtreecommitdiff
path: root/modules/pam_unix/support.c
diff options
context:
space:
mode:
Diffstat (limited to 'modules/pam_unix/support.c')
-rw-r--r--modules/pam_unix/support.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/modules/pam_unix/support.c b/modules/pam_unix/support.c
index bdba3ce5..aa7000b3 100644
--- a/modules/pam_unix/support.c
+++ b/modules/pam_unix/support.c
@@ -444,11 +444,10 @@ int _unix_getpwnam(pam_handle_t *pamh, const char *name,
strlen(sgecos) + 1 +
strlen(shome) + 1 +
strlen(sshell) + 1;
- *ret = malloc(retlen);
+ *ret = calloc(retlen, sizeof(char));
if (*ret == NULL) {
return matched;
}
- memset(*ret, '\0', retlen);
(*ret)->pw_uid = strtol(suid, &p, 10);
if ((strlen(suid) == 0) || (*p != '\0')) {