From: Jaroslav Kysela Date: Sun, 29 Feb 2004 19:33:54 +0000 (+0000) Subject: - fixed open problem (sw_params allocation) X-Git-Tag: v1.0.4~6 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=36df79d94cfe473c80f010af2c64285c98e42759;p=alsa-oss.git - fixed open problem (sw_params allocation) - fixed memory leak (close) - 1.0.3a version --- diff --git a/alsa/pcm.c b/alsa/pcm.c index c5c6377..2463cd3 100644 --- a/alsa/pcm.c +++ b/alsa/pcm.c @@ -428,6 +428,11 @@ int lib_oss_pcm_close(int fd) return -1; } dsp = xfd->dsp; + for (k = 0; k < 2; ++k) { + oss_dsp_stream_t *str = &dsp->streams[k]; + if (str->sw_params) + snd_pcm_sw_params_free(str->sw_params); + } for (k = 0; k < 2; ++k) { int err; oss_dsp_stream_t *str = &dsp->streams[k]; @@ -537,6 +542,10 @@ static int oss_dsp_open(int card, int device, int oflag, mode_t mode) result = snd_pcm_sw_params_malloc(&dsp->streams[k].sw_params); if (result < 0) goto _error; + } + for (k = 0; k < 2; ++k) { + if (!(streams & (1 << k))) + continue; result = snd_pcm_open(&dsp->streams[k].pcm, name, k, pcm_mode); if (result < 0) { if (k == 1 && dsp->streams[0].pcm != NULL) { diff --git a/configure.in b/configure.in index 8865f40..7d49512 100644 --- a/configure.in +++ b/configure.in @@ -1,5 +1,5 @@ AC_INIT(alsa/alsa-oss.c) -AM_INIT_AUTOMAKE(alsa-oss, 1.0.3) +AM_INIT_AUTOMAKE(alsa-oss, 1.0.3a) AC_PREFIX_DEFAULT(/usr)