mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-03 09:01:52 -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
|
|
@ -206,12 +206,11 @@ int snd_hwdep_close(snd_hwdep_t *hwdep)
|
|||
{
|
||||
int err;
|
||||
assert(hwdep);
|
||||
if ((err = hwdep->ops->close(hwdep)) < 0)
|
||||
return err;
|
||||
err = hwdep->ops->close(hwdep);
|
||||
if (hwdep->name)
|
||||
free(hwdep->name);
|
||||
free(hwdep);
|
||||
return 0;
|
||||
return err;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue