From 8c8c168a565aea308f0ad02538d87682be519f10 Mon Sep 17 00:00:00 2001
From: deuce <>
Date: Tue, 30 Sep 2008 03:24:44 +0000
Subject: [PATCH] Call snd_pcm_hw_params_free() right after they are used.

---
 src/xpdev/xpbeep.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/xpdev/xpbeep.c b/src/xpdev/xpbeep.c
index c574b5dc93..4a2fc7175d 100644
--- a/src/xpdev/xpbeep.c
+++ b/src/xpdev/xpbeep.c
@@ -474,6 +474,7 @@ BOOL xptone_open(void)
 				}
 			}
 			else {
+				alsa_api->snd_pcm_hw_params_free(hw_params);
 				handle_type=SOUND_DEVICE_ALSA;
 				return(TRUE);
 			}
@@ -624,7 +625,6 @@ void xp_play_sample_thread(void *data)
 
 	#ifdef USE_ALSA_SOUND
 		if(handle_type==SOUND_DEVICE_ALSA) {
-			alsa_api->snd_pcm_hw_params_free(hw_params);
 			if(playback_handle != NULL) {
 				if(alsa_api->snd_pcm_writei(playback_handle, sample_buffer, sample_size)!=sample_size) {
 					/* Go back and try OSS */
@@ -760,7 +760,6 @@ BOOL DLLCALL xp_play_sample(const unsigned char *sample, size_t sample_size, BOO
 
 #ifdef USE_ALSA_SOUND
 	if(handle_type==SOUND_DEVICE_ALSA) {
-		alsa_api->snd_pcm_hw_params_free(hw_params);
 		if(playback_handle != NULL) {
 			if(alsa_api->snd_pcm_writei(playback_handle, sample, sample_size)!=sample_size) {
 				/* Go back and try OSS */
-- 
GitLab