summaryrefslogtreecommitdiffstats
path: root/src/lib/krb5/os/realm_dom.c
diff options
context:
space:
mode:
authorDanilo Almeida <dalmeida@mit.edu>1999-08-05 20:37:18 +0000
committerDanilo Almeida <dalmeida@mit.edu>1999-08-05 20:37:18 +0000
commit300ef32ed9238d8728b427a0379cfc685f247e7f (patch)
tree68a734c09c0cdeb9f266cb00a07fa0eb3889fd2a /src/lib/krb5/os/realm_dom.c
parentfb112355a2d57fffc76e66437083f9c6261acfd1 (diff)
downloadkrb5-300ef32ed9238d8728b427a0379cfc685f247e7f.tar.gz
krb5-300ef32ed9238d8728b427a0379cfc685f247e7f.tar.xz
krb5-300ef32ed9238d8728b427a0379cfc685f247e7f.zip
* t_std_conf.c (test_get_krbhst): Use krb5_free_krbhst to
free buffers allocated by krb5_get_krbhst. * locate_kdc.c (_krb5_use_dns): Add _krb_use_dns to abstract away looking up of whether we use DNS or not in the profile. * ktdefname.c (krb5_kt_default_name): Use profile_release_string instead of free to free string allocated by profile_get_string. * get_krbhst.c (krb5_get_krbhst): Copy results from profile_get_values into malloc'ed buffers so we can safely free them later. Also call profile_free_list on the original values. * locate_kdc.c (krb5_locate_kdc): * hst_realm.c (krb5_get_host_realm): * def_realm.c (krb5_get_default_realm): Use _krb5_use_dns to figure out whether to use DNS or not instead of directly reading the profile in this routine. * realm_dom.c (krb5_get_realm_domain): * hst_realm.c (krb5_get_host_realm): * def_realm.c (krb5_get_default_realm): Copy results of profile_get_string into malloc'ed buffer so it can safely be free'd later. * locate_kdc.c (krb5_locate_srv_conf): * def_realm.c (krb5_get_default_realm): * changepw.c (krb5_change_password): * an_to_ln.c (krb5_aname_to_localname): Use profile_free_list to free values allocated by profile_get_values. * init_os_ctx.c (os_init_paths): Wrap use of ctx->profile_in_memory with KRB5_DNS_LOOKUP. Use pointer value to determine whether to free files by checking the files value rather than depending on the return value. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11626 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib/krb5/os/realm_dom.c')
-rw-r--r--src/lib/krb5/os/realm_dom.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/lib/krb5/os/realm_dom.c b/src/lib/krb5/os/realm_dom.c
index 8880c589d5..3d0b64ebdf 100644
--- a/src/lib/krb5/os/realm_dom.c
+++ b/src/lib/krb5/os/realm_dom.c
@@ -49,8 +49,19 @@ krb5_get_realm_domain(context, realm, domain)
char **domain;
{
krb5_error_code retval;
+ char *temp_domain = 0;
retval = profile_get_string(context->profile, "realms", realm,
- "default_domain", realm, domain);
+ "default_domain", realm, &temp_domain);
+ if (!retval && temp_domain)
+ {
+ *domain = malloc(strlen(temp_domain) + 1);
+ if (!*domain) {
+ retval = ENOMEM;
+ } else {
+ strcpy(*domain, temp_domain);
+ }
+ profile_release_string(temp_domain);
+ }
return retval;
}