config: fix crash caused by strdup(NULL)
This commit is contained in:
parent
7b3982eb65
commit
3a0ee199dc
|
@ -235,11 +235,12 @@ XF86OptionPtr
|
||||||
xf86optionListDup (XF86OptionPtr opt)
|
xf86optionListDup (XF86OptionPtr opt)
|
||||||
{
|
{
|
||||||
XF86OptionPtr newopt = NULL;
|
XF86OptionPtr newopt = NULL;
|
||||||
|
char *val;
|
||||||
|
|
||||||
while (opt)
|
while (opt)
|
||||||
{
|
{
|
||||||
newopt = xf86addNewOption(newopt, strdup(opt->opt_name),
|
val = opt->opt_val ? strdup(opt->opt_val) : NULL;
|
||||||
strdup(opt->opt_val));
|
newopt = xf86addNewOption(newopt, strdup(opt->opt_name), val);
|
||||||
newopt->opt_used = opt->opt_used;
|
newopt->opt_used = opt->opt_used;
|
||||||
if (opt->opt_comment)
|
if (opt->opt_comment)
|
||||||
newopt->opt_comment = strdup(opt->opt_comment);
|
newopt->opt_comment = strdup(opt->opt_comment);
|
||||||
|
|
Loading…
Reference in New Issue