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>
This commit is contained in:
parent
f0d7e9db28
commit
f2a6735cfc
|
@ -340,7 +340,7 @@ pointer
|
||||||
xf86AddNewOption(pointer head, const char *name, const char *val)
|
xf86AddNewOption(pointer head, const char *name, const char *val)
|
||||||
{
|
{
|
||||||
/* XXX These should actually be allocated in the parser library. */
|
/* 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);
|
char *tmp_name = strdup(name);
|
||||||
|
|
||||||
return xf86addNewOption(head, tmp_name, tmp);
|
return xf86addNewOption(head, tmp_name, tmp);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user