summaryrefslogtreecommitdiffstats
path: root/crypto/heimdal/lib/krb5/rd_cred.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/heimdal/lib/krb5/rd_cred.c')
-rw-r--r--crypto/heimdal/lib/krb5/rd_cred.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/crypto/heimdal/lib/krb5/rd_cred.c b/crypto/heimdal/lib/krb5/rd_cred.c
index c7729b1..746e2d1 100644
--- a/crypto/heimdal/lib/krb5/rd_cred.c
+++ b/crypto/heimdal/lib/krb5/rd_cred.c
@@ -33,7 +33,7 @@
#include <krb5_locl.h>
-RCSID("$Id: rd_cred.c,v 1.14 2001/05/14 06:14:50 assar Exp $");
+RCSID("$Id: rd_cred.c,v 1.15 2001/06/29 14:53:44 assar Exp $");
krb5_error_code
krb5_rd_cred(krb5_context context,
@@ -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;
OpenPOWER on IntegriCloud