Do not abort in snd_xxx_close() functions

Remove several memory leaks by not aborting prematurely from a
snd_xxx_close() function when some operation fails.
This can happen when a USB device was unplugged.
This commit is contained in:
Clemens Ladisch 2006-02-27 09:54:57 +00:00
parent f9c7321670
commit 45850439b3
11 changed files with 33 additions and 33 deletions

View file

@ -889,16 +889,15 @@ static int snd_pcm_hw_munmap(snd_pcm_t *pcm ATTRIBUTE_UNUSED)
static int snd_pcm_hw_close(snd_pcm_t *pcm)
{
snd_pcm_hw_t *hw = pcm->private_data;
int err;
int err = 0;
if (close(hw->fd)) {
err = -errno;
SYSMSG("close failed\n");
return err;
}
snd_pcm_hw_munmap_status(pcm);
snd_pcm_hw_munmap_control(pcm);
free(hw);
return 0;
return err;
}
static snd_pcm_sframes_t snd_pcm_hw_mmap_commit(snd_pcm_t *pcm,