From 4f925fec96c90f4ce2cd6eaa4827af404a5d46fd Mon Sep 17 00:00:00 2001 From: Tom Yu Date: Mon, 3 Jan 2005 21:50:47 +0000 Subject: [PATCH] pullup from trunk ticket: 2858 version_fixed: 1.4 component: krb5-libs git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-4@16993 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/krb/ChangeLog | 4 ++++ src/lib/krb5/krb/parse.c | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/lib/krb5/krb/ChangeLog b/src/lib/krb5/krb/ChangeLog index 46483aca3..4b01bfcb8 100644 --- a/src/lib/krb5/krb/ChangeLog +++ b/src/lib/krb5/krb/ChangeLog @@ -1,3 +1,7 @@ +2005-01-03 Ken Raeburn + + * parse.c (krb5_parse_name): Don't cache the default realm name. + 2004-10-26 Tom Yu * mk_req_ext.c (krb5_mk_req_extended): Free keyblock before diff --git a/src/lib/krb5/krb/parse.c b/src/lib/krb5/krb/parse.c index 50f7b225b..cd23d14d1 100644 --- a/src/lib/krb5/krb/parse.c +++ b/src/lib/krb5/krb/parse.c @@ -73,8 +73,8 @@ krb5_parse_name(krb5_context context, const char *name, krb5_principal *nprincip const char *parsed_realm = NULL; int fcompsize[FCOMPNUM]; unsigned int realmsize = 0; - static char *default_realm = NULL; - static int default_realm_size = 0; + char *default_realm = NULL; + int default_realm_size = 0; char *tmpdata; krb5_principal principal; krb5_error_code retval; @@ -211,6 +211,7 @@ krb5_parse_name(krb5_context context, const char *name, krb5_principal *nprincip if (tmpdata == 0) { krb5_xfree(principal->data); krb5_xfree(principal); + krb5_xfree(default_realm); return ENOMEM; } krb5_princ_set_realm_length(context, principal, realmsize); @@ -224,6 +225,7 @@ krb5_parse_name(krb5_context context, const char *name, krb5_principal *nprincip krb5_xfree(krb5_princ_realm(context, principal)->data); krb5_xfree(principal->data); krb5_xfree(principal); + krb5_xfree(default_realm); return(ENOMEM); } krb5_princ_component(context, principal, i)->data = tmpdata2; @@ -276,6 +278,7 @@ krb5_parse_name(krb5_context context, const char *name, krb5_principal *nprincip principal->magic = KV5M_PRINCIPAL; principal->realm.magic = KV5M_DATA; *nprincipal = principal; + krb5_xfree(default_realm); return(0); } -- 2.26.2