(copy_general_string): use strdup
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@12087 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -38,10 +38,9 @@ RCSID("$Id$");
|
||||
int
|
||||
copy_general_string (const general_string *from, general_string *to)
|
||||
{
|
||||
*to = malloc(strlen(*from) + 1);
|
||||
*to = strdup(*from);
|
||||
if(*to == NULL)
|
||||
return ENOMEM;
|
||||
strcpy(*to, *from);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user