Replace malloc/strlen/strcpy with strdup.
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Matt Turner <mattst88@gmail.com>
This commit is contained in:
@@ -1154,8 +1154,7 @@ void
|
||||
AssignTypeAndName(DeviceIntPtr dev, Atom type, char *name)
|
||||
{
|
||||
dev->xinput_type = type;
|
||||
dev->name = (char *)malloc(strlen(name) + 1);
|
||||
strcpy(dev->name, name);
|
||||
dev->name = strdup(name);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
||||
Reference in New Issue
Block a user