diff --git a/client/X11/xf_cliprdr.c b/client/X11/xf_cliprdr.c index 8a7f25a0e..3baa2395c 100644 --- a/client/X11/xf_cliprdr.c +++ b/client/X11/xf_cliprdr.c @@ -154,8 +154,9 @@ static void xf_cliprdr_clear_cached_data(xfClipboard* clipboard); static UINT xf_cliprdr_send_client_format_list(xfClipboard* clipboard, BOOL force); static void xf_cliprdr_set_selection_owner(xfContext* xfc, xfClipboard* clipboard, Time timestamp); -static void xf_cached_data_free(xfCachedData* cached_data) +static void xf_cached_data_free(void* ptr) { + xfCachedData* cached_data = ptr; if (!cached_data) return; diff --git a/client/common/client_cliprdr_file.c b/client/common/client_cliprdr_file.c index 3f9c016a0..f9c7c8fa4 100644 --- a/client/common/client_cliprdr_file.c +++ b/client/common/client_cliprdr_file.c @@ -1535,6 +1535,8 @@ fail: return cliprdr_file_context_send_file_contents_failure(file, fileContentsRequest); } +static void cliprdr_local_stream_free(void* obj); + static UINT change_lock(CliprdrFileContext* file, UINT32 lockId, BOOL lock) { UINT rc = CHANNEL_RC_OK; diff --git a/libfreerdp/emu/scard/smartcard_emulate.c b/libfreerdp/emu/scard/smartcard_emulate.c index 2505b7d21..65760743b 100644 --- a/libfreerdp/emu/scard/smartcard_emulate.c +++ b/libfreerdp/emu/scard/smartcard_emulate.c @@ -188,6 +188,18 @@ static BOOL wchar_compare(const void* a, const void* b) return _wcscmp(wa, wb) == 0; } +static void* str_copy(const void* ptr) +{ + const char* src = ptr; + return _strdup(src); +} + +static void* wstr_copy(const void* ptr) +{ + const WCHAR* src = ptr; + return _wcsdup(src); +} + static SCardContext* scard_context_new(void) { SCardContext* ctx = calloc(1, sizeof(SCardContext)); @@ -215,7 +227,7 @@ static SCardContext* scard_context_new(void) WINPR_ASSERT(val); key->fnObjectEquals = char_compare; - key->fnObjectNew = (OBJECT_NEW_FN)_strdup; + key->fnObjectNew = str_copy; key->fnObjectFree = free; val->fnObjectFree = free; @@ -232,7 +244,7 @@ static SCardContext* scard_context_new(void) WINPR_ASSERT(val); key->fnObjectEquals = wchar_compare; - key->fnObjectNew = (OBJECT_NEW_FN)_wcsdup; + key->fnObjectNew = wstr_copy; key->fnObjectFree = free; val->fnObjectFree = free; diff --git a/server/proxy/pf_context.c b/server/proxy/pf_context.c index cef8854d8..812fc7338 100644 --- a/server/proxy/pf_context.c +++ b/server/proxy/pf_context.c @@ -126,10 +126,10 @@ static BOOL client_to_proxy_context_new(freerdp_peer* client, rdpContext* ctx) goto error; obj = HashTable_KeyObject(context->channelsByFrontId); - obj->fnObjectEquals = (OBJECT_EQUALS_FN)ChannelId_Compare; + obj->fnObjectEquals = ChannelId_Compare; obj = HashTable_ValueObject(context->channelsByFrontId); - obj->fnObjectFree = (OBJECT_FREE_FN)StaticChannelContext_free; + obj->fnObjectFree = StaticChannelContext_free; context->channelsByBackId = HashTable_New(FALSE); if (!context->channelsByBackId) @@ -138,7 +138,7 @@ static BOOL client_to_proxy_context_new(freerdp_peer* client, rdpContext* ctx) goto error; obj = HashTable_KeyObject(context->channelsByBackId); - obj->fnObjectEquals = (OBJECT_EQUALS_FN)ChannelId_Compare; + obj->fnObjectEquals = ChannelId_Compare; return TRUE;