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)
Wed, Jan 29, 8:30 PM
Unknown Object (File)
Thu, Jan 23, 5:33 AM
Unknown Object (File)
Thu, Jan 23, 5:02 AM
Unknown Object (File)
Wed, Jan 22, 9:11 PM
Unknown Object (File)
Dec 21 2024, 2:55 AM
Unknown Object (File)
Sep 26 2024, 9:51 PM
Unknown Object (File)
Sep 22 2024, 7:07 PM
Unknown Object (File)
Sep 16 2024, 9:25 AM
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.