pam_auth: Correct use of calloc()

v0.8
Andri Yngvason 2023-12-10 18:51:58 +00:00
parent fcfd4280b7
commit 830142701a
1 changed files with 1 additions and 1 deletions

View File

@ -30,7 +30,7 @@ static int pam_return_pwd(int num_msg, const struct pam_message** msgm,
struct pam_response** response, void* appdata_ptr) struct pam_response** response, void* appdata_ptr)
{ {
struct credentials* cred = appdata_ptr; struct credentials* cred = appdata_ptr;
struct pam_response* resp = calloc(sizeof(*response), num_msg); struct pam_response* resp = calloc(num_msg, sizeof(*resp));
for (int i = 0; i < num_msg; i++) { for (int i = 0; i < num_msg; i++) {
resp[i].resp_retcode = PAM_SUCCESS; resp[i].resp_retcode = PAM_SUCCESS;
switch(msgm[i]->msg_style) { switch(msgm[i]->msg_style) {