From 75ab8323b2289f0ef2dd76bdce6a7dabc2c72c3f Mon Sep 17 00:00:00 2001 From: John Kohl Date: Tue, 30 Apr 1991 11:34:29 +0000 Subject: [PATCH] use a common strdup() git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@2064 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/os/get_krbhst.c | 13 +------------ src/lib/krb5/os/sn2princ.c | 12 ------------ 2 files changed, 1 insertion(+), 24 deletions(-) diff --git a/src/lib/krb5/os/get_krbhst.c b/src/lib/krb5/os/get_krbhst.c index 6660708ca..dc75422b3 100644 --- a/src/lib/krb5/os/get_krbhst.c +++ b/src/lib/krb5/os/get_krbhst.c @@ -49,17 +49,6 @@ static char rcsid_get_krbhst_c [] = extern char *krb5_config_file; /* extern so can be set at load/runtime */ -static char * -strsave(string) -char *string; -{ - register char *cp; - cp = malloc(strlen(string)+1); - if (cp) - (void) strcpy(cp, string); - return(cp); -} - krb5_error_code krb5_get_krbhst(realm, hostlist) krb5_data *realm; @@ -94,7 +83,7 @@ char ***hostlist; retval = KRB5_CONFIG_BADFORMAT; break; } - rethlist[hlindex] = strsave(&filebuf[realm->length+1]); + rethlist[hlindex] = strdup(&filebuf[realm->length+1]); if (!rethlist[hlindex]) { for (--hlindex; hlindex >= 0; hlindex--) free(rethlist[hlindex]); diff --git a/src/lib/krb5/os/sn2princ.c b/src/lib/krb5/os/sn2princ.c index 71f4d4f41..450449473 100644 --- a/src/lib/krb5/os/sn2princ.c +++ b/src/lib/krb5/os/sn2princ.c @@ -23,18 +23,6 @@ static char rcsid_sn2princ_c[] = #include #include -#ifndef HAVE_STRDUP -static char * -strdup(s) -register char *s; -{ - register char *ret; - if (ret = (char *)malloc(strlen(s)+1)) - strcpy(ret, s); - return(ret); -} -#endif - krb5_error_code krb5_sname_to_principal(DECLARG(const char *,hostname), DECLARG(const char *,sname), -- 2.26.2