use krb5_principal_set_realm

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22726 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2008-03-24 12:06:38 +00:00
parent ba287b247d
commit 457dbdfb8b

View File

@@ -198,16 +198,12 @@ krb5_verify_user_opt(krb5_context context,
ret = KRB5_CONFIG_NODEFREALM;
for (r = realms; *r != NULL && ret != 0; ++r) {
char *tmp = strdup (*r);
if (tmp == NULL) {
ret = krb5_principal_set_realm(context, principal, *r);
if (ret) {
krb5_free_host_realm (context, realms);
krb5_set_error_string (context, "malloc: out of memory");
return ENOMEM;
return ret;
}
free (*krb5_princ_realm (context, principal));
krb5_princ_set_realm (context, principal, &tmp);
ret = verify_user_opt_int(context, principal, password, opt);
}
krb5_free_host_realm (context, realms);