diff options
author | marha <marha@users.sourceforge.net> | 2011-04-14 08:39:30 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2011-04-14 08:39:30 +0000 |
commit | 898081f31f99dc35a1602a607a07d1aaff49ac40 (patch) | |
tree | b2adbc0fd699cc5dc2af141df26130e7874f9369 /xorg-server/hw/xfree86/loader/loadmod.c | |
parent | c1e91b66cbcf91645f65b9d63f115dcb5a441406 (diff) | |
parent | 019fc27ce6dc2a1809107be10d4deb80e0fa436b (diff) | |
download | vcxsrv-898081f31f99dc35a1602a607a07d1aaff49ac40.tar.gz vcxsrv-898081f31f99dc35a1602a607a07d1aaff49ac40.tar.bz2 vcxsrv-898081f31f99dc35a1602a607a07d1aaff49ac40.zip |
svn merge ^/branches/released .
Diffstat (limited to 'xorg-server/hw/xfree86/loader/loadmod.c')
-rw-r--r-- | xorg-server/hw/xfree86/loader/loadmod.c | 32 |
1 files changed, 12 insertions, 20 deletions
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
|