From c22d9844a459095378538309dcdbb0101d335e55 Mon Sep 17 00:00:00 2001 From: akallabeth Date: Mon, 18 Mar 2024 10:17:29 +0100 Subject: [PATCH] [client,common] fix incompatible-pointer-types use a union to cast to expected types. --- client/common/file.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/client/common/file.c b/client/common/file.c index feb37967f..39b08f18c 100644 --- a/client/common/file.c +++ b/client/common/file.c @@ -2299,9 +2299,15 @@ BOOL freerdp_client_populate_settings_from_rdp_file(const rdpFile* file, rdpSett if (~file->RedirectLocation) { size_t count = 0; - char** str = CommandLineParseCommaSeparatedValuesEx(LOCATION_CHANNEL_NAME, NULL, &count); - const BOOL rc = freerdp_client_add_dynamic_channel(settings, count, str); - free(str); + union + { + void* pv; + char** str; + const char** cstr; + } cnv; + cnv.str = CommandLineParseCommaSeparatedValuesEx(LOCATION_CHANNEL_NAME, NULL, &count); + const BOOL rc = freerdp_client_add_dynamic_channel(settings, count, cnv.cstr); + free(cnv.pv); if (!rc) return FALSE; }