svn rev #24723: trunk/src/kdc/
ghudson@MIT.EDU
ghudson at MIT.EDU
Thu Mar 17 18:08:22 EDT 2011
http://src.mit.edu/fisheye/changelog/krb5/?cs=24723
Commit By: ghudson
Log Message:
Don't leak the default realm name when initializing the default realm
in the KDC.
Changed Files:
U trunk/src/kdc/main.c
Modified: trunk/src/kdc/main.c
===================================================================
--- trunk/src/kdc/main.c 2011-03-17 20:02:01 UTC (rev 24722)
+++ trunk/src/kdc/main.c 2011-03-17 22:08:22 UTC (rev 24723)
@@ -162,6 +162,8 @@
static void
finish_realm(kdc_realm_t *rdp)
{
+ if (rdp->realm_name)
+ free(rdp->realm_name);
if (rdp->realm_mpname)
free(rdp->realm_mpname);
if (rdp->realm_stash)
@@ -290,7 +292,11 @@
goto whoops;
}
- rdp->realm_name = realm;
+ rdp->realm_name = strdup(realm);
+ if (rdp->realm_name == NULL) {
+ kret = ENOMEM;
+ goto whoops;
+ }
kret = krb5int_init_context_kdc(&rdp->realm_context);
if (kret) {
kdc_err(NULL, kret, "while getting context for realm %s", realm);
@@ -863,6 +869,7 @@
kdc_realmlist[0] = rdatap;
kdc_numrealms++;
}
+ krb5_free_default_realm(kcontext, lrealm);
}
/* Ensure that this is set for our first request. */
More information about the cvs-krb5
mailing list