Page MenuHomeFreeBSD

sound: Fix memory leak in chn_init()
ClosedPublic

Authored by christos on Jul 15 2024, 3:58 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Aug 31, 12:34 PM
Unknown Object (File)
Wed, Aug 26, 1:46 PM
Unknown Object (File)
Tue, Aug 25, 4:27 PM
Unknown Object (File)
Tue, Aug 25, 1:02 PM
Unknown Object (File)
Sat, Aug 22, 1:28 PM
Unknown Object (File)
Sat, Aug 22, 1:26 PM
Unknown Object (File)
Sat, Aug 15, 4:31 PM
Unknown Object (File)
Sat, Aug 8, 3:13 AM
Subscribers

Details

Summary

In case chn_init() fails, we are leaking memory by not freeing the
feeder.

Sponsored by: The FreeBSD Foundation
MFC after: 2 days

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Jul 19 2024, 12:01 AM
markj added inline comments.
sys/dev/sound/pcm/channel.c
1369

Since this strange-looking while loop appears in several places now, it would a good idea to move it into a subroutine.

sys/dev/sound/pcm/channel.c
1369

Maybe it's better to just modify the function directly?

sys/dev/sound/pcm/channel.c
1369

That works too.

christos added inline comments.
sys/dev/sound/pcm/channel.c
1369
This revision was automatically updated to reflect the committed changes.
christos marked an inline comment as done.