diff options
author | Adam Jackson <ajax@nwnk.net> | 2006-03-15 16:21:04 +0000 |
---|---|---|
committer | Adam Jackson <ajax@nwnk.net> | 2006-03-15 16:21:04 +0000 |
commit | 460f2ea4a594a53536f34c4ad27795fceec50bcc (patch) | |
tree | ff9a25e7eb7d5f63a14d08a2ca9fd3e5e09f7b83 /hw/xfree86/loader/loadmod.c | |
parent | 116d158e85ec43577ff69aeb3271ab1f888500c9 (diff) |
Coverity #794: Fix a highly unlikely memory leak.
Diffstat (limited to 'hw/xfree86/loader/loadmod.c')
-rw-r--r-- | hw/xfree86/loader/loadmod.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c index a887e2597..b14914eb5 100644 --- a/hw/xfree86/loader/loadmod.c +++ b/hw/xfree86/loader/loadmod.c @@ -418,10 +418,6 @@ FindModule(const char *module, const char *dir, const char **subdirlist, #else const char suffix[3][3] = { "a", "o", "so" }; #endif - - subdirs = InitSubdirs(subdirlist); - if (!subdirs) - return NULL; #ifndef __EMX__ dirpath = (char *)dir; @@ -431,7 +427,10 @@ FindModule(const char *module, const char *dir, const char **subdirlist, #endif if (strlen(dirpath) > PATH_MAX) return NULL; - /*xf86Msg(X_INFO,"OS2DIAG: FindModule: dirpath=%s\n",dirpath); */ + + subdirs = InitSubdirs(subdirlist); + if (!subdirs) + return NULL; for (s = subdirs; *s; s++) { if ((dirlen = strlen(dirpath) + strlen(*s)) > PATH_MAX) |