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)
Tue, Nov 5, 7:32 PM
Unknown Object (File)
Fri, Nov 1, 9:53 PM
Unknown Object (File)
Oct 8 2024, 7:12 AM
Unknown Object (File)
Sep 27 2024, 12:55 AM
Unknown Object (File)
Sep 27 2024, 12:45 AM
Unknown Object (File)
Sep 26 2024, 5:11 PM
Unknown Object (File)
Sep 26 2024, 6:31 AM
Unknown Object (File)
Sep 25 2024, 10:49 PM
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.