svn rev #22203: branches/krb5-1-7/src/kdc/
tlyu@MIT.EDU
tlyu at MIT.EDU
Mon Apr 13 16:26:25 EDT 2009
http://src.mit.edu/fisheye/changelog/krb5/?cs=22203
Commit By: tlyu
Log Message:
ticket: 6456
subject: fix memory management in handle_referral_params
version_fixed: 1.7
pull up r22037 from trunk
Fix in handle_referral_params
Changed Files:
U branches/krb5-1-7/src/kdc/main.c
Modified: branches/krb5-1-7/src/kdc/main.c
===================================================================
--- branches/krb5-1-7/src/kdc/main.c 2009-04-13 20:26:22 UTC (rev 22202)
+++ branches/krb5-1-7/src/kdc/main.c 2009-04-13 20:26:24 UTC (rev 22203)
@@ -175,7 +175,6 @@
kdc_realm_t *rdp )
{
krb5_error_code retval = 0;
-
if (no_refrls && krb5_match_config_pattern(no_refrls, KRB5_CONF_ASTERISK) == TRUE) {
rdp->realm_no_host_referral = strdup(KRB5_CONF_ASTERISK);
if (!rdp->realm_no_host_referral)
@@ -192,9 +191,10 @@
else if (asprintf(&(rdp->realm_no_host_referral),"%s%s%s", " ",
rparams->realm_no_host_referral, " ") < 0)
retval = ENOMEM;
- } else if( no_refrls != NULL && asprintf(&(rdp->realm_no_host_referral),"%s%s%s", " ", no_refrls, " ") < 0)
- retval = ENOMEM;
- else
+ } else if( no_refrls != NULL) {
+ if ( asprintf(&(rdp->realm_no_host_referral),"%s%s%s", " ", no_refrls, " ") < 0)
+ retval = ENOMEM;
+ } else
rdp->realm_no_host_referral = NULL;
}
@@ -213,16 +213,17 @@
rdp->realm_host_based_services = strdup(KRB5_CONF_ASTERISK);
if (!rdp->realm_host_based_services)
retval = ENOMEM;
- } else if (host_based_srvcs && asprintf(&(rdp->realm_host_based_services), "%s%s%s%s%s",
+ } else if (host_based_srvcs) {
+ if (asprintf(&(rdp->realm_host_based_services), "%s%s%s%s%s",
" ", host_based_srvcs," ",rparams->realm_host_based_services, " ") < 0)
retval = ENOMEM;
- else if (asprintf(&(rdp->realm_host_based_services),"%s%s%s", " ",
+ } else if (asprintf(&(rdp->realm_host_based_services),"%s%s%s", " ",
rparams->realm_host_based_services, " ") < 0)
retval = ENOMEM;
- } else if(host_based_srvcs != NULL && asprintf(&(rdp->realm_host_based_services),"%s%s%s",
- " ", host_based_srvcs, " ") < 0)
+ } else if (host_based_srvcs) {
+ if (asprintf(&(rdp->realm_host_based_services),"%s%s%s", " ", host_based_srvcs, " ") < 0)
retval = ENOMEM;
- else
+ } else
rdp->realm_host_based_services = NULL;
}
More information about the cvs-krb5
mailing list