mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-29 05:40:25 -04:00
pcm_hw: close file descriptor in the error path in snd_pcm_hw_open() (coverity)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
22ade9b8c1
commit
3ae743efea
1 changed files with 3 additions and 0 deletions
|
|
@ -1724,12 +1724,15 @@ int snd_pcm_hw_open(snd_pcm_t **pcmp, const char *name,
|
|||
}
|
||||
if (info.subdevice != (unsigned int) subdevice) {
|
||||
close(fd);
|
||||
fd = -1;
|
||||
goto __again;
|
||||
}
|
||||
}
|
||||
snd_ctl_close(ctl);
|
||||
return snd_pcm_hw_open_fd(pcmp, name, fd, sync_ptr_ioctl);
|
||||
_err:
|
||||
if (fd >= 0)
|
||||
close(fd);
|
||||
snd_ctl_close(ctl);
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue