diff options
author | des <des@FreeBSD.org> | 2002-02-25 16:39:34 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2002-02-25 16:39:34 +0000 |
commit | 2b3e8246a1c755bfca840257b7906da2a0cf87a4 (patch) | |
tree | d92693112eec9613ff7117f58fd84405a8188d60 /libexec | |
parent | 8b1c00e3bc325d70556b3a67393bca1973758cee (diff) | |
download | FreeBSD-src-2b3e8246a1c755bfca840257b7906da2a0cf87a4.zip FreeBSD-src-2b3e8246a1c755bfca840257b7906da2a0cf87a4.tar.gz |
Rewrite the part of the conversation function that allocates the reply array;
it was inelegant and neglected to check the return value from malloc(3).
Sponsored by: DARPA, NAI Labs
Diffstat (limited to 'libexec')
-rw-r--r-- | libexec/ftpd/ftpd.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c index 6c71150..decc31b 100644 --- a/libexec/ftpd/ftpd.c +++ b/libexec/ftpd/ftpd.c @@ -1111,8 +1111,11 @@ auth_conv(int num_msg, const struct pam_message **msg, { int i; cred_t *cred = (cred_t *) appdata; - struct pam_response *reply = - malloc(sizeof(struct pam_response) * num_msg); + struct pam_response *reply; + + reply = calloc(num_msg, sizeof *reply); + if (reply == NULL) + return PAM_BUF_ERR; for (i = 0; i < num_msg; i++) { switch (msg[i]->msg_style) { |