aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-04-05 14:52:19 +0000
committermarha <marha@users.sourceforge.net>2011-04-05 14:52:19 +0000
commit6254e74e8b2ff8a2a1e8476a3300a7bdd65b7ad6 (patch)
tree02e0d5fd297602d526b582dc527e007fe20a326f /xorg-server/hw
parent1d142834bdb30308784a0654a39b7c0de7e37695 (diff)
parenteaedc21febeadad4cf0e370f5d97e7bdb4470870 (diff)
downloadvcxsrv-6254e74e8b2ff8a2a1e8476a3300a7bdd65b7ad6.tar.gz
vcxsrv-6254e74e8b2ff8a2a1e8476a3300a7bdd65b7ad6.tar.bz2
vcxsrv-6254e74e8b2ff8a2a1e8476a3300a7bdd65b7ad6.zip
svn merge ^/branches/released .
Diffstat (limited to 'xorg-server/hw')
-rw-r--r--xorg-server/hw/xfree86/common/xf86Config.c32
-rw-r--r--xorg-server/hw/xfree86/common/xf86Helper.c1
-rw-r--r--xorg-server/hw/xfree86/common/xf86Init.c4
-rw-r--r--xorg-server/hw/xfree86/dri2/dri2.c9
-rw-r--r--xorg-server/hw/xfree86/loader/loadmod.c6
5 files changed, 40 insertions, 12 deletions
diff --git a/xorg-server/hw/xfree86/common/xf86Config.c b/xorg-server/hw/xfree86/common/xf86Config.c
index bd90e6ca3..4047350c4 100644
--- a/xorg-server/hw/xfree86/common/xf86Config.c
+++ b/xorg-server/hw/xfree86/common/xf86Config.c
@@ -309,7 +309,7 @@ xf86ModulelistFromConfig(pointer **optlist)
}
if (found == FALSE) {
XF86LoadPtr ptr = (XF86LoadPtr)xf86configptr->conf_modules;
- ptr = xf86addNewLoadDirective(ptr, ModuleDefaults[i].name, XF86_LOAD_MODULE, ModuleDefaults[i].load_opt);
+ xf86addNewLoadDirective(ptr, ModuleDefaults[i].name, XF86_LOAD_MODULE, ModuleDefaults[i].load_opt);
xf86Msg(X_INFO, "\"%s\" will be loaded by default.\n", ModuleDefaults[i].name);
}
}
@@ -318,7 +318,7 @@ xf86ModulelistFromConfig(pointer **optlist)
for (i=0 ; ModuleDefaults[i].name != NULL ; i++) {
if (ModuleDefaults[i].toLoad == TRUE) {
XF86LoadPtr ptr = (XF86LoadPtr)xf86configptr->conf_modules;
- ptr = xf86addNewLoadDirective(ptr, ModuleDefaults[i].name, XF86_LOAD_MODULE, ModuleDefaults[i].load_opt);
+ xf86addNewLoadDirective(ptr, ModuleDefaults[i].name, XF86_LOAD_MODULE, ModuleDefaults[i].load_opt);
}
}
}
@@ -1459,8 +1459,9 @@ configInputDevices(XF86ConfLayoutPtr layout, serverLayoutPtr servlayoutp)
while (irp) {
indp[count] = xf86AllocateInput();
if (!configInput(indp[count], irp->iref_inputdev, X_CONFIG)) {
- while(count--)
+ do {
free(indp[count]);
+ } while(count--);
free(indp);
return FALSE;
}
@@ -1485,7 +1486,7 @@ configLayout(serverLayoutPtr servlayoutp, XF86ConfLayoutPtr conf_layout,
{
XF86ConfAdjacencyPtr adjp;
XF86ConfInactivePtr idp;
- int count = 0;
+ int saved_count, count = 0;
int scrnum;
XF86ConfLayoutPtr l;
MessageType from;
@@ -1553,6 +1554,9 @@ configLayout(serverLayoutPtr servlayoutp, XF86ConfLayoutPtr conf_layout,
scrnum = adjp->adj_scrnum;
if (!configScreen(slp[count].screen, adjp->adj_screen, scrnum,
X_CONFIG)) {
+ do {
+ free(slp[count].screen);
+ } while(count--);
free(slp);
return FALSE;
}
@@ -1641,6 +1645,10 @@ configLayout(serverLayoutPtr servlayoutp, XF86ConfLayoutPtr conf_layout,
}
}
+ if (!count)
+ saved_count = 1;
+ else
+ saved_count = count;
/*
* Count the number of inactive devices.
*/
@@ -1657,16 +1665,14 @@ configLayout(serverLayoutPtr servlayoutp, XF86ConfLayoutPtr conf_layout,
idp = conf_layout->lay_inactive_lst;
count = 0;
while (idp) {
- if (!configDevice(&gdp[count], idp->inactive_device, FALSE)) {
- free(gdp);
- return FALSE;
- }
+ if (!configDevice(&gdp[count], idp->inactive_device, FALSE))
+ goto bail;
count++;
idp = (XF86ConfInactivePtr)idp->list.next;
}
if (!configInputDevices(conf_layout, servlayoutp))
- return FALSE;
+ goto bail;
servlayoutp->id = conf_layout->lay_identifier;
servlayoutp->screens = slp;
@@ -1675,6 +1681,14 @@ configLayout(serverLayoutPtr servlayoutp, XF86ConfLayoutPtr conf_layout,
from = X_DEFAULT;
return TRUE;
+
+bail:
+ do {
+ free(slp[saved_count].screen);
+ } while(saved_count--);
+ free(slp);
+ free(gdp);
+ return FALSE;
}
/*
diff --git a/xorg-server/hw/xfree86/common/xf86Helper.c b/xorg-server/hw/xfree86/common/xf86Helper.c
index f94b24184..da15b0503 100644
--- a/xorg-server/hw/xfree86/common/xf86Helper.c
+++ b/xorg-server/hw/xfree86/common/xf86Helper.c
@@ -1831,6 +1831,7 @@ xf86ConfigFbEntity(ScrnInfoPtr pScrn, int scrnFlag, int entityIndex,
xf86SetEntityFuncs(entityIndex,init,enter,leave,private);
+ free(pEnt);
return pScrn;
}
diff --git a/xorg-server/hw/xfree86/common/xf86Init.c b/xorg-server/hw/xfree86/common/xf86Init.c
index e017d9dce..bf72368c4 100644
--- a/xorg-server/hw/xfree86/common/xf86Init.c
+++ b/xorg-server/hw/xfree86/common/xf86Init.c
@@ -1414,8 +1414,10 @@ xf86LoadModules(char **list, pointer *optlist)
name = xf86NormalizeName(list[i]);
/* Skip empty names */
- if (name == NULL || *name == '\0')
+ if (name == NULL || *name == '\0') {
+ free(name);
continue;
+ }
/* Replace obsolete keyboard driver with kbd */
if (!xf86NameCmp(name, "keyboard")) {
diff --git a/xorg-server/hw/xfree86/dri2/dri2.c b/xorg-server/hw/xfree86/dri2/dri2.c
index 7d6f772d7..c754b760f 100644
--- a/xorg-server/hw/xfree86/dri2/dri2.c
+++ b/xorg-server/hw/xfree86/dri2/dri2.c
@@ -221,11 +221,16 @@ DRI2AddDrawableRef(DRI2DrawablePtr pPriv, XID id, XID dri2_id,
if (ref == NULL)
return BadAlloc;
- if (!AddResource(dri2_id, dri2DrawableRes, pPriv))
+ if (!AddResource(dri2_id, dri2DrawableRes, pPriv)) {
+ free(ref);
return BadAlloc;
+ }
if (!DRI2LookupDrawableRef(pPriv, id))
- if (!AddResource(id, dri2DrawableRes, pPriv))
+ if (!AddResource(id, dri2DrawableRes, pPriv)) {
+ FreeResourceByType(dri2_id, dri2DrawableRes, TRUE);
+ free(ref);
return BadAlloc;
+ }
ref->id = id;
ref->dri2_id = dri2_id;
diff --git a/xorg-server/hw/xfree86/loader/loadmod.c b/xorg-server/hw/xfree86/loader/loadmod.c
index 271cb5b79..3e59887db 100644
--- a/xorg-server/hw/xfree86/loader/loadmod.c
+++ b/xorg-server/hw/xfree86/loader/loadmod.c
@@ -532,6 +532,7 @@ LoaderListDirs(const char **subdirlist, const char **patternlist)
FreePathList(pathlist);
FreeSubdirs(subdirs);
FreePatterns(patterns);
+ closedir(d);
return NULL;
}
listing[n] = malloc(len + 1);
@@ -540,6 +541,7 @@ LoaderListDirs(const char **subdirlist, const char **patternlist)
FreePathList(pathlist);
FreeSubdirs(subdirs);
FreePatterns(patterns);
+ closedir(d);
return NULL;
}
strncpy(listing[n], dp->d_name + match[1].rm_so,
@@ -556,6 +558,10 @@ LoaderListDirs(const char **subdirlist, const char **patternlist)
}
if (listing)
listing[n] = NULL;
+
+ FreePathList(pathlist);
+ FreeSubdirs(subdirs);
+ FreePatterns(patterns);
return listing;
}