summaryrefslogtreecommitdiff
path: root/hw/xfree86/common/xf86Configure.c
diff options
context:
space:
mode:
authorMagnus Vigerlöf <Magnus.Vigerlof@home.se>2007-04-10 23:48:00 +0300
committerDaniel Stone <daniels@endtroducing.fooishbar.org>2007-04-10 23:58:20 +0300
commit4771fa8747791498e504d73afccfb5833499a38b (patch)
tree2ed3235b4e2b13c37bc5d7afad969d677ffdbf06 /hw/xfree86/common/xf86Configure.c
parent07c56abf84080c020a3e7b7703a447c7f996975c (diff)
XFree86: Fix memory leak in option parsing
Fix option parsing functions and callers thereof to not leak memory.
Diffstat (limited to 'hw/xfree86/common/xf86Configure.c')
-rw-r--r--hw/xfree86/common/xf86Configure.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/hw/xfree86/common/xf86Configure.c b/hw/xfree86/common/xf86Configure.c
index 4b482dfdc..7b04bd6bd 100644
--- a/hw/xfree86/common/xf86Configure.c
+++ b/hw/xfree86/common/xf86Configure.c
@@ -309,13 +309,16 @@ configureInputSection (void)
mouse->inp_identifier = "Mouse0";
mouse->inp_driver = "mouse";
mouse->inp_option_lst =
- xf86addNewOption(mouse->inp_option_lst, "Protocol", DFLT_MOUSE_PROTO);
+ xf86addNewOption(mouse->inp_option_lst, xstrdup("Protocol"),
+ xstrdup(DFLT_MOUSE_PROTO));
#ifndef __SCO__
mouse->inp_option_lst =
- xf86addNewOption(mouse->inp_option_lst, "Device", DFLT_MOUSE_DEV);
+ xf86addNewOption(mouse->inp_option_lst, xstrdup("Device"),
+ xstrdup(DFLT_MOUSE_DEV));
#endif
mouse->inp_option_lst =
- xf86addNewOption(mouse->inp_option_lst, "ZAxisMapping", "4 5 6 7");
+ xf86addNewOption(mouse->inp_option_lst, xstrdup("ZAxisMapping"),
+ xstrdup("4 5 6 7"));
ptr = (XF86ConfInputPtr)xf86addListItem((glp)ptr, (glp)mouse);
return ptr;
}
@@ -519,7 +522,7 @@ configureLayoutSection (void)
iptr->iref_option_lst = NULL;
iptr->iref_inputdev_str = "Mouse0";
iptr->iref_option_lst =
- xf86addNewOption (iptr->iref_option_lst, "CorePointer", NULL);
+ xf86addNewOption (iptr->iref_option_lst, xstrdup("CorePointer"), NULL);
ptr->lay_input_lst = (XF86ConfInputrefPtr)
xf86addListItem ((glp) ptr->lay_input_lst, (glp) iptr);
}
@@ -532,7 +535,7 @@ configureLayoutSection (void)
iptr->iref_option_lst = NULL;
iptr->iref_inputdev_str = "Keyboard0";
iptr->iref_option_lst =
- xf86addNewOption (iptr->iref_option_lst, "CoreKeyboard", NULL);
+ xf86addNewOption (iptr->iref_option_lst, xstrdup("CoreKeyboard"), NULL);
ptr->lay_input_lst = (XF86ConfInputrefPtr)
xf86addListItem ((glp) ptr->lay_input_lst, (glp) iptr);
}
@@ -751,7 +754,7 @@ configureDDCMonitorSection (int screennum)
}
if (ConfiguredMonitor->features.dpms) {
- ptr->mon_option_lst = xf86addNewOption(ptr->mon_option_lst, "DPMS", NULL);
+ ptr->mon_option_lst = xf86addNewOption(ptr->mon_option_lst, xstrdup("DPMS"), NULL);
}
return ptr;