From: Ken Raeburn Date: Sat, 28 Oct 2006 03:02:38 +0000 (+0000) Subject: use strdup X-Git-Tag: krb5-1.7-alpha1~1482 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=eb99ac4ae7082472fbf7f125da9cad6e52fab090;p=krb5.git use strdup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@18747 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/util/profile/prof_get.c b/src/util/profile/prof_get.c index 08fac7f06..c79500215 100644 --- a/src/util/profile/prof_get.c +++ b/src/util/profile/prof_get.c @@ -431,16 +431,15 @@ profile_iterator(void **iter_p, char **ret_name, char **ret_value) if (ret_name) { if (name) { - *ret_name = malloc(strlen(name)+1); + *ret_name = strdup(name); if (!*ret_name) return ENOMEM; - strcpy(*ret_name, name); } else *ret_name = 0; } if (ret_value) { if (value) { - *ret_value = malloc(strlen(value)+1); + *ret_value = strdup(value); if (!*ret_value) { if (ret_name) { free(*ret_name); @@ -448,7 +447,6 @@ profile_iterator(void **iter_p, char **ret_name, char **ret_value) } return ENOMEM; } - strcpy(*ret_value, value); } else *ret_value = 0; }