diff options
author | Eamon Walsh <ewalsh@tycho.nsa.gov> | 2009-04-09 02:26:24 -0400 |
---|---|---|
committer | Eamon Walsh <ewalsh@tycho.nsa.gov> | 2009-04-09 02:29:28 -0400 |
commit | 3a0ee199dcec39596756a995996eac388acf6315 (patch) | |
tree | 9d729273776f8ead280196ed29101a23a035e42e /hw/xfree86 | |
parent | 7b3982eb6518da33ab01c2fbf7ceb45b89f841df (diff) |
config: fix crash caused by strdup(NULL)
Diffstat (limited to 'hw/xfree86')
-rw-r--r-- | hw/xfree86/parser/Flags.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/hw/xfree86/parser/Flags.c b/hw/xfree86/parser/Flags.c index b4e8d2583..6865d3592 100644 --- a/hw/xfree86/parser/Flags.c +++ b/hw/xfree86/parser/Flags.c @@ -235,11 +235,12 @@ XF86OptionPtr xf86optionListDup (XF86OptionPtr opt) { XF86OptionPtr newopt = NULL; + char *val; while (opt) { - newopt = xf86addNewOption(newopt, strdup(opt->opt_name), - strdup(opt->opt_val)); + val = opt->opt_val ? strdup(opt->opt_val) : NULL; + newopt = xf86addNewOption(newopt, strdup(opt->opt_name), val); newopt->opt_used = opt->opt_used; if (opt->opt_comment) newopt->opt_comment = strdup(opt->opt_comment); |