aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xfree86/common/xf86AutoConfig.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2010-12-08 16:07:08 +0000
committermarha <marha@users.sourceforge.net>2010-12-08 16:07:08 +0000
commit8308417ba79394ca96a326c8cb5c36024b36c1e2 (patch)
treec6e087e837c83457b68a7a10363af47778a9b1b7 /xorg-server/hw/xfree86/common/xf86AutoConfig.c
parentfea28ce54ffbea6eda28791518ccca0e0df2df0d (diff)
parent531a0d974b98074978535f086a73b6b662fa0cea (diff)
downloadvcxsrv-8308417ba79394ca96a326c8cb5c36024b36c1e2.tar.gz
vcxsrv-8308417ba79394ca96a326c8cb5c36024b36c1e2.tar.bz2
vcxsrv-8308417ba79394ca96a326c8cb5c36024b36c1e2.zip
svn merge ^/branches/released .
Diffstat (limited to 'xorg-server/hw/xfree86/common/xf86AutoConfig.c')
-rw-r--r--xorg-server/hw/xfree86/common/xf86AutoConfig.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/xorg-server/hw/xfree86/common/xf86AutoConfig.c b/xorg-server/hw/xfree86/common/xf86AutoConfig.c
index a00340191..14b266d38 100644
--- a/xorg-server/hw/xfree86/common/xf86AutoConfig.c
+++ b/xorg-server/hw/xfree86/common/xf86AutoConfig.c
@@ -282,21 +282,31 @@ listPossibleVideoDrivers(char *matches[], int nmatches)
static Bool
copyScreen(confScreenPtr oscreen, GDevPtr odev, int i, char *driver)
{
+ confScreenPtr nscreen;
GDevPtr cptr = NULL;
- xf86ConfigLayout.screens[i].screen = xnfcalloc(1, sizeof(confScreenRec));
- if(!xf86ConfigLayout.screens[i].screen)
+ nscreen = malloc(sizeof(confScreenRec));
+ if (!nscreen)
return FALSE;
- memcpy(xf86ConfigLayout.screens[i].screen, oscreen, sizeof(confScreenRec));
+ memcpy(nscreen, oscreen, sizeof(confScreenRec));
- cptr = calloc(1, sizeof(GDevRec));
- if (!cptr)
+ cptr = malloc(sizeof(GDevRec));
+ if (!cptr) {
+ free(nscreen);
return FALSE;
+ }
memcpy(cptr, odev, sizeof(GDevRec));
cptr->identifier = Xprintf("Autoconfigured Video Device %s", driver);
+ if (!cptr->identifier) {
+ free(cptr);
+ free(nscreen);
+ return FALSE;
+ }
cptr->driver = driver;
+ xf86ConfigLayout.screens[i].screen = nscreen;
+
/* now associate the new driver entry with the new screen entry */
xf86ConfigLayout.screens[i].screen->device = cptr;
cptr->myScreenSection = xf86ConfigLayout.screens[i].screen;