loader: strdup const string assigned to local variable name

There's a free(name) at the end of the function.

GCC warned about this:

../hw/xfree86/loader/loadmod.c: In function ‘LoadModule’:
../hw/xfree86/loader/loadmod.c:702:18: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  702 |         m = name = "int10";
      |                  ^
This commit is contained in:
Michel Dänzer 2020-01-28 18:22:45 +01:00 committed by Peter Hutterer
parent e1fa3beb2f
commit 65387391a5
1 changed files with 1 additions and 1 deletions

View File

@ -699,7 +699,7 @@ LoadModule(const char *module, void *options, const XF86ModReqInfo *modreq,
/* Backward compatibility, vbe and int10 are merged into int10 now */
if (!strcmp(m, "vbe"))
m = name = "int10";
m = name = strdup("int10");
for (cim = compiled_in_modules; *cim; cim++)
if (!strcmp(m, *cim)) {