From 4dff4ad762eefbe6fd3544aaac84d00b7e7883b5 Mon Sep 17 00:00:00 2001 From: akallabeth Date: Fri, 15 Nov 2024 16:17:25 +0100 Subject: [PATCH] [core,client] fix freerdp_channels_get_id_by_name return 0 in case of a failure. Fixes #10863 --- libfreerdp/core/client.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libfreerdp/core/client.c b/libfreerdp/core/client.c index 5f2f41195..34a5ff1fe 100644 --- a/libfreerdp/core/client.c +++ b/libfreerdp/core/client.c @@ -581,13 +581,13 @@ BOOL freerdp_channels_data(freerdp* instance, UINT16 channelId, const BYTE* cdat UINT16 freerdp_channels_get_id_by_name(freerdp* instance, const char* channel_name) { - rdpMcsChannel* mcsChannel = NULL; if (!instance || !channel_name) - return -1; + return 0; - mcsChannel = freerdp_channels_find_channel_by_name(instance->context->rdp, channel_name); + rdpMcsChannel* mcsChannel = + freerdp_channels_find_channel_by_name(instance->context->rdp, channel_name); if (!mcsChannel) - return -1; + return 0; return mcsChannel->ChannelId; }