Plug minor memory leak of module_t structures when unloading a file

from the kernel.

Reviewed By: Doug Rabson (dfr@)
This commit is contained in:
Peter Edwards 2004-04-09 15:27:38 +00:00
parent c97ed2df4e
commit 24554d00bc

View File

@ -515,8 +515,10 @@ linker_file_unload(linker_file_t file)
} }
for (ml = TAILQ_FIRST(&found_modules); ml; ml = nextml) { for (ml = TAILQ_FIRST(&found_modules); ml; ml = nextml) {
nextml = TAILQ_NEXT(ml, link); nextml = TAILQ_NEXT(ml, link);
if (ml->container == file) if (ml->container == file) {
TAILQ_REMOVE(&found_modules, ml, link); TAILQ_REMOVE(&found_modules, ml, link);
free(ml, M_LINKER);
}
} }
/* /*