From: Theodore Tso Date: Sun, 12 Jun 1994 17:46:09 +0000 (+0000) Subject: Fix so that rc_dfl_resolve(id, name) works when name is NULL X-Git-Tag: krb5-1.0-beta4~100 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=d28ad5837f579b7c7bd2aad4129703234e75c74d;p=krb5.git 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 --- 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 *));