Merge pull request #4774 from akallabeth/audin_leak_fix

Fixed leak in audio format processing.
This commit is contained in:
Martin Fleisz 2018-07-31 11:13:29 +02:00 committed by GitHub
commit 70b3e442ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 8 deletions

View File

@ -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))

View File

@ -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;