aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorTobias Stoeckmann <tobias@stoeckmann.org>2024-01-02 21:14:23 +0100
committerDmitry V. Levin <ldv@strace.io>2024-01-03 17:16:02 +0000
commit5f51dcfa6b804025ed002fe06a0534316d471c0c (patch)
tree18ab7695ceebe18d69de838eb3853c064d9fc48d /modules
parent2e677446e35898f1539e6522a826d392c6abde50 (diff)
downloadpam-5f51dcfa6b804025ed002fe06a0534316d471c0c.tar.gz
pam-5f51dcfa6b804025ed002fe06a0534316d471c0c.tar.bz2
pam-5f51dcfa6b804025ed002fe06a0534316d471c0c.zip
pam_unix: use calloc instead of malloc/memset
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Diffstat (limited to 'modules')
-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')) {