mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2026-03-24 09:05:43 -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) {
|
if (info.subdevice != (unsigned int) subdevice) {
|
||||||
close(fd);
|
close(fd);
|
||||||
|
fd = -1;
|
||||||
goto __again;
|
goto __again;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
snd_ctl_close(ctl);
|
snd_ctl_close(ctl);
|
||||||
return snd_pcm_hw_open_fd(pcmp, name, fd, sync_ptr_ioctl);
|
return snd_pcm_hw_open_fd(pcmp, name, fd, sync_ptr_ioctl);
|
||||||
_err:
|
_err:
|
||||||
|
if (fd >= 0)
|
||||||
|
close(fd);
|
||||||
snd_ctl_close(ctl);
|
snd_ctl_close(ctl);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue