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
|
@ -242,12 +242,11 @@ int snd_timer_close(snd_timer_t *timer)
|
|||
snd_async_handler_t *h = list_entry(timer->async_handlers.next, snd_async_handler_t, hlist);
|
||||
snd_async_del_handler(h);
|
||||
}
|
||||
if ((err = timer->ops->close(timer)) < 0)
|
||||
return err;
|
||||
err = timer->ops->close(timer);
|
||||
if (timer->name)
|
||||
free(timer->name);
|
||||
free(timer);
|
||||
return 0;
|
||||
return err;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue