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;
|
int i;
|
||||||
char *name;
|
char *name;
|
||||||
Bool failed = FALSE;
|
Bool failed = FALSE;
|
||||||
ModuleDescPtr desc;
|
|
||||||
|
|
||||||
if (!list)
|
if (!list)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -1946,14 +1945,9 @@ xf86LoadModules(char **list, pointer *optlist)
|
||||||
else
|
else
|
||||||
opt = NULL;
|
opt = NULL;
|
||||||
|
|
||||||
desc = LoadModule(name, NULL, NULL, NULL, opt, NULL, &errmaj,
|
if (!LoadModule(name, NULL, NULL, NULL, opt, NULL, &errmaj, &errmin)) {
|
||||||
&errmin);
|
|
||||||
if (!desc) {
|
|
||||||
LoaderErrorMsg(NULL, name, errmaj, errmin);
|
LoaderErrorMsg(NULL, name, errmaj, errmin);
|
||||||
failed = TRUE;
|
failed = TRUE;
|
||||||
} else {
|
|
||||||
xfree(desc->name);
|
|
||||||
xfree(desc);
|
|
||||||
}
|
}
|
||||||
xfree(name);
|
xfree(name);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue