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
|
|
@ -1029,8 +1029,6 @@ int snd_seq_close(snd_seq_t *seq)
|
|||
int err;
|
||||
assert(seq);
|
||||
err = seq->ops->close(seq);
|
||||
if (err < 0)
|
||||
return err;
|
||||
if (seq->obuf)
|
||||
free(seq->obuf);
|
||||
if (seq->ibuf)
|
||||
|
|
@ -1040,7 +1038,7 @@ int snd_seq_close(snd_seq_t *seq)
|
|||
if (seq->name)
|
||||
free(seq->name);
|
||||
free(seq);
|
||||
return 0;
|
||||
return err;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue