From: Tom Yu Date: Mon, 3 Jan 2005 21:50:47 +0000 (+0000) Subject: pullup from trunk X-Git-Tag: krb5-1.4.3-beta1~117 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4f925fec96c90f4ce2cd6eaa4827af404a5d46fd;p=krb5.git 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 --- 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); }