summaryrefslogtreecommitdiffstats
path: root/crypto/heimdal/lib/krb5/mcache.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/heimdal/lib/krb5/mcache.c')
-rw-r--r--crypto/heimdal/lib/krb5/mcache.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/crypto/heimdal/lib/krb5/mcache.c b/crypto/heimdal/lib/krb5/mcache.c
index 29c5cfd..8c44b6e 100644
--- a/crypto/heimdal/lib/krb5/mcache.c
+++ b/crypto/heimdal/lib/krb5/mcache.c
@@ -33,7 +33,7 @@
#include "krb5_locl.h"
-RCSID("$Id: mcache.c,v 1.12 2000/11/15 02:12:51 assar Exp $");
+RCSID("$Id: mcache.c,v 1.13 2001/05/14 06:14:49 assar Exp $");
typedef struct krb5_mcache {
char *name;
@@ -65,6 +65,7 @@ static krb5_mcache *
mcc_alloc(const char *name)
{
krb5_mcache *m;
+
ALLOC(m, 1);
if(m == NULL)
return NULL;
@@ -101,8 +102,10 @@ mcc_resolve(krb5_context context, krb5_ccache *id, const char *res)
}
m = mcc_alloc(res);
- if (m == NULL)
+ if (m == NULL) {
+ krb5_set_error_string (context, "malloc: out of memory");
return KRB5_CC_NOMEM;
+ }
(*id)->data.data = m;
(*id)->data.length = sizeof(*m);
@@ -118,8 +121,10 @@ mcc_gen_new(krb5_context context, krb5_ccache *id)
m = mcc_alloc(NULL);
- if (m == NULL)
+ if (m == NULL) {
+ krb5_set_error_string (context, "malloc: out of memory");
return KRB5_CC_NOMEM;
+ }
(*id)->data.data = m;
(*id)->data.length = sizeof(*m);
@@ -203,8 +208,10 @@ mcc_store_cred(krb5_context context,
return ENOENT;
l = malloc (sizeof(*l));
- if (l == NULL)
+ if (l == NULL) {
+ krb5_set_error_string (context, "malloc: out of memory");
return KRB5_CC_NOMEM;
+ }
l->next = m->creds;
m->creds = l;
memset (&l->cred, 0, sizeof(l->cred));
OpenPOWER on IntegriCloud