Commit db53bdfc authored by David Reid's avatar David Reid

Fix a memory leak.

parent 403e9f7a
...@@ -20595,6 +20595,8 @@ static ma_result ma_device_init_by_type__alsa(ma_device* pDevice, const ma_devic ...@@ -20595,6 +20595,8 @@ static ma_result ma_device_init_by_type__alsa(ma_device* pDevice, const ma_devic
/* We can now extract the PCM poll descriptors which we place after the wakeup descriptor. */ /* We can now extract the PCM poll descriptors which we place after the wakeup descriptor. */
pollDescriptorCount = ((ma_snd_pcm_poll_descriptors_proc)pDevice->pContext->alsa.snd_pcm_poll_descriptors)(pPCM, pPollDescriptors + 1, pollDescriptorCount); /* +1 because we want to place these descriptors after the wakeup descriptor. */ pollDescriptorCount = ((ma_snd_pcm_poll_descriptors_proc)pDevice->pContext->alsa.snd_pcm_poll_descriptors)(pPCM, pPollDescriptors + 1, pollDescriptorCount); /* +1 because we want to place these descriptors after the wakeup descriptor. */
if (pollDescriptorCount <= 0) { if (pollDescriptorCount <= 0) {
close(wakeupfd);
ma_free(pPollDescriptors, &pDevice->pContext->allocationCallbacks);
((ma_snd_pcm_close_proc)pDevice->pContext->alsa.snd_pcm_close)(pPCM); ((ma_snd_pcm_close_proc)pDevice->pContext->alsa.snd_pcm_close)(pPCM);
return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[ALSA] Failed to retrieve poll descriptors.", MA_ERROR); return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[ALSA] Failed to retrieve poll descriptors.", MA_ERROR);
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment