rdpsnd: Fix double frees in rdpsnd context cleanup

This commit is contained in:
Martin Fleisz 2021-07-07 10:43:40 +02:00 committed by akallabeth
parent ea79ab5ff0
commit 8c0cf7cd4b

View File

@ -1513,8 +1513,13 @@ static UINT rdpsnd_on_close(IWTSVirtualChannelCallback* pChannelCallback)
if (rdpsnd->device)
IFCALL(rdpsnd->device->Close, rdpsnd->device);
freerdp_dsp_context_free(rdpsnd->dsp_context);
StreamPool_Return(rdpsnd->pool, rdpsnd->data_in);
StreamPool_Free(rdpsnd->pool);
rdpsnd->dsp_context = NULL;
if (rdpsnd->pool)
{
StreamPool_Return(rdpsnd->pool, rdpsnd->data_in);
StreamPool_Free(rdpsnd->pool);
rdpsnd->pool = NULL;
}
audio_formats_free(rdpsnd->ClientFormats, rdpsnd->NumberOfClientFormats);
rdpsnd->NumberOfClientFormats = 0;