+Thu Dec 21 17:51:58 1995 Theodore Y. Ts'o <tytso@dcl>
+
+ * Makefile.in (t_an_to_ln): Use $(LD) instead of $(CC) to link
+ final executables, so that we can more easily use purify.
+
+ * hst_realm.c (krb5_get_host_realm): Eliminate memory leak; realm
+ was already being allocated by the profile library; no
+ reason to reallocate it again.
+
Wed Nov 15 10:53:16 1995 <tytso@rsts-11.mit.edu>
* promptusr.c: New function for doing generic tty input and output.
$(TOPLIBD)/libcrypto.a $(COMERRLIB)
t_std_conf: $(T_STD_CONF_OBJS)
- $(CC) -o t_std_conf $(T_STD_CONF_OBJS) $(LIBS)
+ $(LD) -o t_std_conf $(T_STD_CONF_OBJS) $(LIBS)
t_an_to_ln: $(T_AN_TO_LN_OBJS)
- $(CC) -o t_an_to_ln $(T_AN_TO_LN_OBJS) $(LIBS)
+ $(LD) -o t_an_to_ln $(T_AN_TO_LN_OBJS) $(LIBS)
check-unix:: $(TEST_PROGS)
KRB5_CONFIG=$(srcdir)/td_krb5.conf ; export KRB5_CONFIG ;\
char ***realmsp;
{
char **retrealms;
- char *domain, *default_realm, *realm, *cp;
+ char *default_realm, *realm, *cp;
krb5_error_code retval;
int l;
char local_host[MAXHOSTNAMELEN+1];
}
}
- if (realm != (char *)NULL)
- {
- /* We found an exact match */
- if (!(cp = (char *)malloc(strlen(realm)+1)))
- return ENOMEM;
- strcpy(cp, realm);
- realm = cp;
- }
- else if (default_realm != (char *)NULL)
- {
- /* We are defaulting to the realm of the host */
- if (!(cp = (char *)malloc(strlen(default_realm)+1)))
- return ENOMEM;
- strcpy(cp, default_realm);
- realm = cp;
-
- /* Assume the realm name is upper case */
- for (cp = realm; *cp; cp++)
- if (islower(*cp))
- *cp = toupper(*cp);
- cp = realm;
- }
- else
- {
- /* We are defaulting to the local realm */
- retval = krb5_get_default_realm(context, &cp);
- if (retval) {
- return retval;
- }
+ if (realm == (char *)NULL) {
+ if (default_realm != (char *)NULL) {
+ /* We are defaulting to the realm of the host */
+ if (!(cp = (char *)malloc(strlen(default_realm)+1)))
+ return ENOMEM;
+ strcpy(cp, default_realm);
+ realm = cp;
+
+ /* Assume the realm name is upper case */
+ for (cp = realm; *cp; cp++)
+ if (islower(*cp))
+ *cp = toupper(*cp);
+ } else {
+ /* We are defaulting to the local realm */
+ retval = krb5_get_default_realm(context, &realm);
+ if (retval) {
+ return retval;
+ }
+ }
}
if (!(retrealms = (char **)calloc(2, sizeof(*retrealms)))) {
if (realm != (char *)NULL)
return ENOMEM;
}
- retrealms[0] = cp;
+ retrealms[0] = realm;
retrealms[1] = 0;
*realmsp = retrealms;