Page MenuHomeFreeBSD

Memory leaks in libc's nis_passwd() and nisgroup()
ClosedPublic

Authored by pfg on Feb 15 2015, 9:23 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 14, 9:03 PM
Unknown Object (File)
Fri, Nov 14, 9:03 PM
Unknown Object (File)
Fri, Nov 14, 6:17 PM
Unknown Object (File)
Thu, Nov 13, 1:32 AM
Unknown Object (File)
Wed, Nov 12, 2:00 AM
Unknown Object (File)
Fri, Oct 24, 10:18 PM
Unknown Object (File)
Oct 15 2025, 1:32 PM
Unknown Object (File)
Sep 29 2025, 4:07 PM
Subscribers

Details

Reviewers
delphij
Summary

CID 1016715
CID 1016717

Resource leak (RESOURCE_LEAK)17. leaked_storage:
Variable result going out of scope leaks the storage it points to.

The code is somewhat tricky so it's not a good idea
free the variable before the return as we can cause
double free()s; instead free the memory just before
jumping to the label.

Test Plan

I don't generally use NIS, but that's the area that might most
likely be affected.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

pfg retitled this revision from to Memory leaks in libc's nis_passwd() and nisgroup().
pfg updated this object.
pfg edited the test plan for this revision. (Show Details)
This comment was removed by pfg.
delphij added a reviewer: delphij.
delphij added a subscriber: delphij.

Looks reasonable to me.

This revision is now accepted and ready to land.Feb 20 2015, 12:29 AM

Committed as rI279035.