GUACAMOLE-847: Fix severe memory leak when using audio with RDP

This commit is contained in:
Frank Riley 2019-07-19 22:36:06 -07:00
parent b4ef38c064
commit 87a5479ff8

View File

@ -110,35 +110,36 @@ void guac_rdpsnd_process_receive(rdpSvcPlugin* plugin,
* If next PDU is SNDWAVE (due to receiving WaveInfo PDU previously), * If next PDU is SNDWAVE (due to receiving WaveInfo PDU previously),
* ignore the header and parse as a Wave PDU. * ignore the header and parse as a Wave PDU.
*/ */
if (rdpsnd->next_pdu_is_wave) { if (rdpsnd->next_pdu_is_wave)
guac_rdpsnd_wave_handler(rdpsnd, input_stream, &header); guac_rdpsnd_wave_handler(rdpsnd, input_stream, &header);
return;
}
/* Dispatch message to standard handlers */ /* Dispatch message to standard handlers */
switch (header.message_type) { else {
switch (header.message_type) {
/* Server Audio Formats and Version PDU */ /* Server Audio Formats and Version PDU */
case SNDC_FORMATS: case SNDC_FORMATS:
guac_rdpsnd_formats_handler(rdpsnd, input_stream, &header); guac_rdpsnd_formats_handler(rdpsnd, input_stream, &header);
break; break;
/* Training PDU */ /* Training PDU */
case SNDC_TRAINING: case SNDC_TRAINING:
guac_rdpsnd_training_handler(rdpsnd, input_stream, &header); guac_rdpsnd_training_handler(rdpsnd, input_stream, &header);
break; break;
/* WaveInfo PDU */ /* WaveInfo PDU */
case SNDC_WAVE: case SNDC_WAVE:
guac_rdpsnd_wave_info_handler(rdpsnd, input_stream, &header); guac_rdpsnd_wave_info_handler(rdpsnd, input_stream, &header);
break; break;
/* Close PDU */ /* Close PDU */
case SNDC_CLOSE: case SNDC_CLOSE:
guac_rdpsnd_close_handler(rdpsnd, input_stream, &header); guac_rdpsnd_close_handler(rdpsnd, input_stream, &header);
break; break;
}
} }
Stream_Free(input_stream, TRUE);
} }