Fixed memory leak.

This commit is contained in:
Armin Novak 2013-09-02 10:57:33 +02:00
parent 62356e667c
commit 854aa3fcfa

View File

@ -381,7 +381,10 @@ void rdpsnd_send_wave_confirm_pdu(rdpsndPlugin* rdpsnd, UINT16 wTimeStamp, BYTE
void rdpsnd_device_send_wave_confirm_pdu(rdpsndDevicePlugin* device, RDPSND_WAVE* wave)
{
MessageQueue_Post(device->rdpsnd->queue, NULL, 0, (void*) wave, NULL);
RDPSND_WAVE *copy = malloc(sizeof(RDPSND_WAVE));
CopyMemory(copy, wave, sizeof(RDPSND_WAVE));
MessageQueue_Post(device->rdpsnd->queue, NULL, 0, (void*) copy, NULL);
}
static void rdpsnd_recv_wave_pdu(rdpsndPlugin* rdpsnd, wStream* s)
@ -444,6 +447,7 @@ static void rdpsnd_recv_wave_pdu(rdpsndPlugin* rdpsnd, wStream* s)
wave->wLocalTimeB = wave->wLocalTimeA + wave->wAudioLength + TIME_DELAY_MS;
rdpsnd->device->WaveConfirm(rdpsnd->device, wave);
}
free(wave);
}
static void rdpsnd_recv_close_pdu(rdpsndPlugin* rdpsnd)