From: Greg Hudson Date: Fri, 1 May 2009 20:07:13 +0000 (+0000) Subject: Move an error check to an earlier location in krb5_524_conv_principal X-Git-Tag: krb5-1.8-alpha1~507 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=fb013ee162e24046b8e0270ff2e5626c8f8f398d;p=krb5.git Move an error check to an earlier location in krb5_524_conv_principal to fix a memory leak. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22300 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/krb/conv_princ.c b/src/lib/krb5/krb/conv_princ.c index 3247893bc..43c588f0f 100644 --- a/src/lib/krb5/krb/conv_princ.c +++ b/src/lib/krb5/krb/conv_princ.c @@ -156,6 +156,9 @@ krb5_524_conv_principal(krb5_context context, krb5_const_principal princ, unsigned int tmp_realm_len; int retval; + if (context->profile == 0) + return KRB5_CONFIG_CANTOPEN; + *name = *inst = '\0'; switch (krb5_princ_size(context, princ)) { case 2: @@ -218,8 +221,6 @@ krb5_524_conv_principal(krb5_context context, krb5_const_principal princ, /* Ask for v4_realm corresponding to krb5 principal realm from krb5.conf realms stanza */ - if (context->profile == 0) - return KRB5_CONFIG_CANTOPEN; retval = profile_get_string(context->profile, KRB5_CONF_REALMS, tmp_prealm, KRB5_CONF_V4_REALM, 0, &tmp_realm);