Coverity #794: Fix a highly unlikely memory leak.

This commit is contained in:
Adam Jackson 2006-03-15 16:21:04 +00:00
parent 116d158e85
commit 460f2ea4a5
2 changed files with 5 additions and 5 deletions

View File

@ -4,6 +4,7 @@
Coverity #1053: Nuke a dead variable.
Coverity #269: Compare the requested ABI class against the ABI class
of the module, not the module class.
Coverity #794: Fix a highly unlikely memory leak.
* miext/cw/cw.c:
Coverity #337: Remove useless NULL check.

View File

@ -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)