Page MenuHomeFreeBSD

Don't leak addrinfo if ai->ai_addrlen <= minsiz test fails
ClosedPublic

Authored by truckman on Jun 8 2016, 8:48 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 23 2024, 1:47 AM
Unknown Object (File)
Feb 16 2024, 7:56 AM
Unknown Object (File)
Feb 16 2024, 6:44 AM
Unknown Object (File)
Aug 24 2023, 12:00 AM
Unknown Object (File)
Aug 6 2023, 9:19 AM
Unknown Object (File)
Jul 21 2023, 4:22 AM
Unknown Object (File)
Jul 10 2023, 7:14 PM
Unknown Object (File)
Jul 10 2023, 7:14 PM
Subscribers

Details

Summary

If the ai->ai_addrlen <= minsiz test fails, then
freeaddrinfo() does not get called to free the memory
just allocated by getaddrinfo(). Fix by moving
ai->ai_addrlen <= minsiz to a separate if block
so that freeaddrinfo() will be called whenever
getaddrinfo() succeeds.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

truckman retitled this revision from to Don't leak addrinfo if ai->ai_addrlen <= minsiz test fails.
truckman updated this object.
truckman edited the test plan for this revision. (Show Details)
truckman added a reviewer: ume.
ume edited edge metadata.

It seems good to me.

This revision is now accepted and ready to land.Jun 8 2016, 9:11 AM
This revision was automatically updated to reflect the committed changes.