mirror of
https://github.com/X11Libre/xserver.git
synced 2026-04-14 17:18:09 +00:00
xfree86: loader: add assert() in LoadModule()
There's (remote) chance that the (internal) module name could become NULL (eg. allocation failure). Even though chances to hit it are very low, it's still better to have a check here (that doesn't cost us much), just in case. Assert fail is still better than segfault, since we're at least getting some hint what might have happened. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
@@ -702,6 +702,8 @@ LoadModule(const char *module, void *options, const XF86ModReqInfo *modreq,
|
||||
if (!strcmp(m, "vbe"))
|
||||
m = name = strdup("int10");
|
||||
|
||||
assert(m);
|
||||
|
||||
for (cim = compiled_in_modules; *cim; cim++)
|
||||
if (!strcmp(m, *cim)) {
|
||||
LogMessageVerb(X_INFO, 3, "Module \"%s\" already built-in\n", m);
|
||||
|
||||
Reference in New Issue
Block a user