mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-30 13:44:55 +00:00
sound: Fix memory leak in chn_init()
In case chn_init() fails, we are leaking memory by not freeing the feeder. Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch, markj Differential Revision: https://reviews.freebsd.org/D45979
This commit is contained in:
parent
94a86f3f69
commit
16329b7b32
|
@ -1365,6 +1365,8 @@ chn_init(struct snddev_info *d, struct pcm_channel *parent, kobj_class_t cls,
|
|||
if (CHN_LOCKOWNED(c))
|
||||
CHN_UNLOCK(c);
|
||||
if (ret) {
|
||||
while (chn_removefeeder(c) == 0)
|
||||
;
|
||||
if (c->devinfo) {
|
||||
if (CHANNEL_FREE(c->methods, c->devinfo))
|
||||
sndbuf_free(b);
|
||||
|
|
Loading…
Reference in a new issue