From f2a6735cfc07789cca81852b24a85578f200d83d Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 4 Jul 2011 12:34:32 +1000 Subject: [PATCH] xfree86: NULL option values are technically valid, don't strdup them Signed-off-by: Peter Hutterer Reviewed-by: Daniel Stone --- hw/xfree86/common/xf86Option.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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);