[core,client] fix freerdp_channels_get_id_by_name

return 0 in case of a failure. Fixes #10863
This commit is contained in:
akallabeth 2024-11-15 16:17:25 +01:00
parent 393560dedf
commit 4dff4ad762
No known key found for this signature in database
GPG Key ID: A49454A3FC909FD5

View File

@ -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) UINT16 freerdp_channels_get_id_by_name(freerdp* instance, const char* channel_name)
{ {
rdpMcsChannel* mcsChannel = NULL;
if (!instance || !channel_name) 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) if (!mcsChannel)
return -1; return 0;
return mcsChannel->ChannelId; return mcsChannel->ChannelId;
} }