(krb5_rd_cred): check calloc return value
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@10198 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -181,6 +181,12 @@ krb5_rd_cred(krb5_context context,
|
||||
*ret_creds = calloc(enc_krb_cred_part.ticket_info.len + 1,
|
||||
sizeof(**ret_creds));
|
||||
|
||||
if (*ret_creds == NULL) {
|
||||
ret = ENOMEM;
|
||||
krb5_set_error_string (context, "malloc: out of memory");
|
||||
goto out;
|
||||
}
|
||||
|
||||
for (i = 0; i < enc_krb_cred_part.ticket_info.len; ++i) {
|
||||
KrbCredInfo *kci = &enc_krb_cred_part.ticket_info.val[i];
|
||||
krb5_creds *creds;
|
||||
|
Reference in New Issue
Block a user