From d28ad5837f579b7c7bd2aad4129703234e75c74d Mon Sep 17 00:00:00 2001 From: Theodore Tso Date: Sun, 12 Jun 1994 17:46:09 +0000 Subject: [PATCH] Fix so that rc_dfl_resolve(id, name) works when name is NULL git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@3753 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/rcache/rc_dfl.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/lib/krb5/rcache/rc_dfl.c b/src/lib/krb5/rcache/rc_dfl.c index 0c012b7a8..2130f2c53 100644 --- a/src/lib/krb5/rcache/rc_dfl.c +++ b/src/lib/krb5/rcache/rc_dfl.c @@ -254,12 +254,15 @@ char *name; return KRB5_RC_MALLOC; id->data = (krb5_pointer) t; memset(t, 0, sizeof(struct dfl_data)); - t->name = malloc(strlen(name)+1); - if (!t->name) { - retval = KRB5_RC_MALLOC; - goto cleanup; - } - strcpy(t->name, name); + if (name) { + t->name = malloc(strlen(name)+1); + if (!t->name) { + retval = KRB5_RC_MALLOC; + goto cleanup; + } + strcpy(t->name, name); + } else + t->name = 0; t->numhits = t->nummisses = 0; t->hsize = HASHSIZE; /* no need to store---it's memory-only */ t->h = (struct authlist **) malloc(t->hsize*sizeof(struct authlist *)); -- 2.26.2