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, rdpsnd_get_audio_tag_string(format.wFormatTag), format.nChannels, format.nSamplesPerSec,
format.nBlockAlign, format.wBitsPerSample, format.cbSize); format.nBlockAlign, format.wBitsPerSample, format.cbSize);
if (audin->fixed_format > 0 && audin->fixed_format != format.wFormatTag) if ((audin->fixed_format > 0 && audin->fixed_format != format.wFormatTag) ||
continue; (audin->fixed_channel > 0 && audin->fixed_channel != format.nChannels) ||
(audin->fixed_rate > 0 && audin->fixed_rate != format.nSamplesPerSec))
if (audin->fixed_channel > 0 && audin->fixed_channel != format.nChannels) {
continue; free(format.data);
if (audin->fixed_rate > 0 && audin->fixed_rate != format.nSamplesPerSec)
continue; continue;
}
if (freerdp_dsp_supports_format(&format, TRUE) || if (freerdp_dsp_supports_format(&format, TRUE) ||
audin->device->FormatSupported(audin->device, &format)) 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) static BOOL rdp_client_reconnect_channels(rdpRdp* rdp, BOOL redirect)
{ {
BOOL status; BOOL status = FALSE;
rdpContext* context; rdpContext* context;
rdpChannels* channels; rdpChannels* channels;