mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-04 13:30:08 -05:00
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:
parent
f9c7321670
commit
45850439b3
11 changed files with 33 additions and 33 deletions
|
|
@ -64,10 +64,7 @@ static int snd_pcm_plug_close(snd_pcm_t *pcm)
|
|||
int err, result = 0;
|
||||
if (plug->ttable)
|
||||
free(plug->ttable);
|
||||
if (plug->gen.slave != plug->req_slave) {
|
||||
SNDERR("plug slaves mismatch");
|
||||
return -EINVAL;
|
||||
}
|
||||
assert(plug->gen.slave == plug->req_slave);
|
||||
if (plug->gen.close_slave) {
|
||||
snd_pcm_unlink_hw_ptr(pcm, plug->req_slave);
|
||||
snd_pcm_unlink_appl_ptr(pcm, plug->req_slave);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue