From 7355b4e5f3a3704e45618db55f8a50c8760d8207 Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Tue, 31 Jul 2018 10:33:19 +0200 Subject: [PATCH 1/2] Fixed leak in audio format processing. --- channels/audin/client/audin_main.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/channels/audin/client/audin_main.c b/channels/audin/client/audin_main.c index 619286dd7..1e3aa5a72 100644 --- a/channels/audin/client/audin_main.c +++ b/channels/audin/client/audin_main.c @@ -255,14 +255,13 @@ static UINT audin_process_formats(AUDIN_PLUGIN* audin, AUDIN_CHANNEL_CALLBACK* c rdpsnd_get_audio_tag_string(format.wFormatTag), format.nChannels, format.nSamplesPerSec, format.nBlockAlign, format.wBitsPerSample, format.cbSize); - if (audin->fixed_format > 0 && audin->fixed_format != format.wFormatTag) - continue; - - if (audin->fixed_channel > 0 && audin->fixed_channel != format.nChannels) - continue; - - if (audin->fixed_rate > 0 && audin->fixed_rate != format.nSamplesPerSec) + if ((audin->fixed_format > 0 && audin->fixed_format != format.wFormatTag) || + (audin->fixed_channel > 0 && audin->fixed_channel != format.nChannels) || + (audin->fixed_rate > 0 && audin->fixed_rate != format.nSamplesPerSec)) + { + free(format.data); continue; + } if (freerdp_dsp_supports_format(&format, TRUE) || audin->device->FormatSupported(audin->device, &format)) From 3a30844db823497c3cc08749f65285805028df56 Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Tue, 31 Jul 2018 10:45:04 +0200 Subject: [PATCH 2/2] Added default return value. --- libfreerdp/core/connection.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libfreerdp/core/connection.c b/libfreerdp/core/connection.c index 1aebc7604..5f029b352 100644 --- a/libfreerdp/core/connection.c +++ b/libfreerdp/core/connection.c @@ -355,7 +355,7 @@ BOOL rdp_client_disconnect_and_clear(rdpRdp* rdp) static BOOL rdp_client_reconnect_channels(rdpRdp* rdp, BOOL redirect) { - BOOL status; + BOOL status = FALSE; rdpContext* context; rdpChannels* channels;