pullup from trunk
authorTom Yu <tlyu@mit.edu>
Mon, 3 Jan 2005 21:50:47 +0000 (21:50 +0000)
committerTom Yu <tlyu@mit.edu>
Mon, 3 Jan 2005 21:50:47 +0000 (21:50 +0000)
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
src/lib/krb5/krb/parse.c

index 46483aca3494406419307c582d0ee9f848622f58..4b01bfcb83b5a4a875a66e8b6acfa9cbacc2290a 100644 (file)
@@ -1,3 +1,7 @@
+2005-01-03  Ken Raeburn  <raeburn@mit.edu>
+
+       * parse.c (krb5_parse_name): Don't cache the default realm name.
+
 2004-10-26  Tom Yu  <tlyu@mit.edu>
 
        * mk_req_ext.c (krb5_mk_req_extended): Free keyblock before
index 50f7b225bd117ac04d0d4bfce1ae4727897982e0..cd23d14d1701ec9da4cd45d6340f398ddfb0c5d3 100644 (file)
@@ -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);
 }