summaryrefslogtreecommitdiff
path: root/hw/xfree86/parser/Flags.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/xfree86/parser/Flags.c')
-rw-r--r--hw/xfree86/parser/Flags.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/hw/xfree86/parser/Flags.c b/hw/xfree86/parser/Flags.c
index 7fafb6ca8..a9149c243 100644
--- a/hw/xfree86/parser/Flags.c
+++ b/hw/xfree86/parser/Flags.c
@@ -364,12 +364,8 @@ xf86optionListCreate( const char **options, int count, int used )
}
for (i = 0; i < count; i += 2)
{
- t1 = malloc (sizeof (char) *
- (strlen (options[i]) + 1));
- strcpy (t1, options[i]);
- t2 = malloc (sizeof (char) *
- (strlen (options[i + 1]) + 1));
- strcpy (t2, options[i + 1]);
+ t1 = strdup(options[i]);
+ t2 = strdup(options[i + 1]);
p = addNewOption2 (p, t1, t2, used);
}