summaryrefslogtreecommitdiff
path: root/hw/xfree86/common/xf86Option.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/xfree86/common/xf86Option.c')
-rw-r--r--hw/xfree86/common/xf86Option.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/xfree86/common/xf86Option.c b/hw/xfree86/common/xf86Option.c
index 480f38694..a3a836fc1 100644
--- a/hw/xfree86/common/xf86Option.c
+++ b/hw/xfree86/common/xf86Option.c
@@ -340,7 +340,7 @@ pointer
xf86AddNewOption(pointer head, const char *name, const char *val)
{
/* XXX These should actually be allocated in the parser library. */
- char *tmp = strdup(val);
+ char *tmp = val ? strdup(val) : NULL;
char *tmp_name = strdup(name);
return xf86addNewOption(head, tmp_name, tmp);