From 300ef32ed9238d8728b427a0379cfc685f247e7f Mon Sep 17 00:00:00 2001 From: Danilo Almeida Date: Thu, 5 Aug 1999 20:37:18 +0000 Subject: * 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 --- src/lib/krb5/os/realm_dom.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/lib/krb5/os/realm_dom.c') 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; } -- cgit