summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2011-07-04 12:34:32 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2011-07-28 09:45:16 +1000
commit2d94a7d8c2223243fd860bd01f6fdeff91856679 (patch)
tree5e4f83d5dafb1df82656e59f898cedcf5cb6388c
parentf8f6783b9d4bc4106a33e43a1ddb9c0744e2c741 (diff)
xfree86: NULL option values are technically valid, don't strdup them
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> (cherry picked from commit f2a6735cfc07789cca81852b24a85578f200d83d)
-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);