diff options
Diffstat (limited to 'xorg-server/hw')
-rw-r--r-- | xorg-server/hw/xfree86/common/xf86xv.c | 9 | ||||
-rw-r--r-- | xorg-server/hw/xfree86/loader/loadmod.c | 32 |
2 files changed, 20 insertions, 21 deletions
diff --git a/xorg-server/hw/xfree86/common/xf86xv.c b/xorg-server/hw/xfree86/common/xf86xv.c index 8115075b3..416842473 100644 --- a/xorg-server/hw/xfree86/common/xf86xv.c +++ b/xorg-server/hw/xfree86/common/xf86xv.c @@ -313,6 +313,7 @@ xf86XVFreeAdaptor(XvAdaptorPtr pAdaptor) int i;
free(pAdaptor->name);
+ pAdaptor->name = NULL;
if(pAdaptor->pEncodings) {
XvEncodingPtr pEncode = pAdaptor->pEncodings;
@@ -320,9 +321,11 @@ xf86XVFreeAdaptor(XvAdaptorPtr pAdaptor) for(i = 0; i < pAdaptor->nEncodings; i++, pEncode++)
free(pEncode->name);
free(pAdaptor->pEncodings);
+ pAdaptor->pEncodings = NULL;
}
free(pAdaptor->pFormats);
+ pAdaptor->pFormats = NULL;
if(pAdaptor->pPorts) {
XvPortPtr pPort = pAdaptor->pPorts;
@@ -341,18 +344,22 @@ xf86XVFreeAdaptor(XvAdaptorPtr pAdaptor) }
}
free(pAdaptor->pPorts);
+ pAdaptor->pPorts = NULL;
}
- if(pAdaptor->nAttributes) {
+ if(pAdaptor->pAttributes) {
XvAttributePtr pAttribute = pAdaptor->pAttributes;
for(i = 0; i < pAdaptor->nAttributes; i++, pAttribute++)
free(pAttribute->name);
free(pAdaptor->pAttributes);
+ pAdaptor->pAttributes = NULL;
}
free(pAdaptor->pImages);
free(pAdaptor->devPriv.ptr);
+ pAdaptor->pImages = NULL;
+ pAdaptor->devPriv.ptr = NULL;
}
static Bool
diff --git a/xorg-server/hw/xfree86/loader/loadmod.c b/xorg-server/hw/xfree86/loader/loadmod.c index 3e59887db..cf231c1f0 100644 --- a/xorg-server/hw/xfree86/loader/loadmod.c +++ b/xorg-server/hw/xfree86/loader/loadmod.c @@ -483,19 +483,15 @@ LoaderListDirs(const char **subdirlist, const char **patternlist) char *fp;
char **listing = NULL;
char **save;
+ char **ret = NULL;
int n = 0;
if (!(pathlist = InitPathList(NULL)))
return NULL;
- if (!(subdirs = InitSubdirs(subdirlist))) {
- FreePathList(pathlist);
- return NULL;
- }
- if (!(patterns = InitPatterns(patternlist))) {
- FreePathList(pathlist);
- FreeSubdirs(subdirs);
- return NULL;
- }
+ if (!(subdirs = InitSubdirs(subdirlist)))
+ goto bail;
+ if (!(patterns = InitPatterns(patternlist)))
+ goto bail;
for (elem = pathlist; *elem; elem++) {
for (s = subdirs; *s; s++) {
@@ -529,20 +525,14 @@ LoaderListDirs(const char **subdirlist, const char **patternlist) save[n] = NULL;
FreeStringList(save);
}
- FreePathList(pathlist);
- FreeSubdirs(subdirs);
- FreePatterns(patterns);
closedir(d);
- return NULL;
+ goto bail;
}
listing[n] = malloc(len + 1);
if (!listing[n]) {
FreeStringList(listing);
- FreePathList(pathlist);
- FreeSubdirs(subdirs);
- FreePatterns(patterns);
closedir(d);
- return NULL;
+ goto bail;
}
strncpy(listing[n], dp->d_name + match[1].rm_so,
len);
@@ -558,11 +548,13 @@ LoaderListDirs(const char **subdirlist, const char **patternlist) }
if (listing)
listing[n] = NULL;
+ ret = listing;
- FreePathList(pathlist);
- FreeSubdirs(subdirs);
+bail:
FreePatterns(patterns);
- return listing;
+ FreeSubdirs(subdirs);
+ FreePathList(pathlist);
+ return ret;
}
void
|