Revert "xfree86: plug a memory leak in xf86LoadModules."
This reverts commit3abce3ea2b
and6cbaf15e61
. The memory returned to xf86LoadModule was allocated in doLoadModule, which calls the respective module's PreInit. As it turns out, input and output drivers store a pointer to the module elswhere, so freeing it in xf86LoadModule is a bad idea. For further reference: hw/xfree86/common/xf86Helper.c Input drivers: xf86InputDriverList[blah]->module = module; Output drivers: xf86DriverList[blah]->module = module; Unloading the module would not look pretty then.
This commit is contained in:
parent
5f5ec5db35
commit
67a78e84a8
|
@ -1922,7 +1922,6 @@ xf86LoadModules(char **list, pointer *optlist)
|
|||
int i;
|
||||
char *name;
|
||||
Bool failed = FALSE;
|
||||
ModuleDescPtr desc;
|
||||
|
||||
if (!list)
|
||||
return TRUE;
|
||||
|
@ -1946,14 +1945,9 @@ xf86LoadModules(char **list, pointer *optlist)
|
|||
else
|
||||
opt = NULL;
|
||||
|
||||
desc = LoadModule(name, NULL, NULL, NULL, opt, NULL, &errmaj,
|
||||
&errmin);
|
||||
if (!desc) {
|
||||
if (!LoadModule(name, NULL, NULL, NULL, opt, NULL, &errmaj, &errmin)) {
|
||||
LoaderErrorMsg(NULL, name, errmaj, errmin);
|
||||
failed = TRUE;
|
||||
} else {
|
||||
xfree(desc->name);
|
||||
xfree(desc);
|
||||
}
|
||||
xfree(name);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user