From 65387391a551fff6fec808d48b9bf4b6181cb050 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Tue, 28 Jan 2020 18:22:45 +0100 Subject: [PATCH] loader: strdup const string assigned to local variable name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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"; | ^ --- hw/xfree86/loader/loadmod.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c index 81a3a1dd9..f8a44827f 100644 --- a/hw/xfree86/loader/loadmod.c +++ b/hw/xfree86/loader/loadmod.c @@ -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)) {