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:
Clemens Ladisch 2006-02-27 09:54:57 +00:00
parent f9c7321670
commit 45850439b3
11 changed files with 33 additions and 33 deletions

View file

@ -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;
}
/**