]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
auth: Avoid a memset with calloc
authorVolker Lendecke <vl@samba.org>
Tue, 13 Jan 2026 07:51:29 +0000 (08:51 +0100)
committerVolker Lendecke <vl@samba.org>
Tue, 20 Jan 2026 11:53:34 +0000 (11:53 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
source3/auth/pampass.c

index 88a909b7bd26578a1ad5a0a158a28078714c5658..0fee228b381b1a879643986d8f937dd7b9fc0da0 100644 (file)
@@ -148,12 +148,10 @@ static int smb_pam_conv(int num_msg,
                return PAM_CONV_ERR;
        }
 
-       reply = SMB_MALLOC_ARRAY(struct pam_response, num_msg);
+       reply = SMB_CALLOC_ARRAY(struct pam_response, num_msg);
        if (!reply)
                return PAM_CONV_ERR;
 
-       memset(reply, '\0', sizeof(struct pam_response) * num_msg);
-
        for (replies = 0; replies < num_msg; replies++) {
                switch (msg[replies]->msg_style) {
                        case PAM_PROMPT_ECHO_ON: