From 23eb7aba6486087a9b9c8216d2c0b5cd667d515a Mon Sep 17 00:00:00 2001 From: Paulo Cesar Pereira de Andrade Date: Tue, 29 Apr 2008 16:59:21 -0300 Subject: [PATCH] Fix a crash if xorg.conf doesn't have a Files section. The crash happens when opening the "Expert Mode" interface. --- hw/xfree86/utils/xorgcfg/expert.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/hw/xfree86/utils/xorgcfg/expert.c b/hw/xfree86/utils/xorgcfg/expert.c index 5c22a6e..497e620 100644 --- a/hw/xfree86/utils/xorgcfg/expert.c +++ b/hw/xfree86/utils/xorgcfg/expert.c @@ -460,11 +460,15 @@ PopdownCallback(Widget w, XtPointer user_data, XtPointer call_data) static void CreateFiles(TreeNode *files) { - XF86ConfFilesPtr file = XF86Config->conf_files; + XF86ConfFilesPtr file; TreeNode *node, *fontpath, *modulepath; Widget w; char *value; + if (XF86Config->conf_files == NULL) + XF86Config->conf_files = (XF86ConfFilesPtr) + XtCalloc(1, sizeof(XF86ConfFilesRec)); + file = XF86Config->conf_files; value = file->file_logfile ? file->file_logfile : ""; node = NewNode(files, NULL, NULL, files->node, (TreeData*)XtCalloc(1, sizeof(TreeData))); -- 1.5.4.3