Page MenuHomeFreeBSD

Plug Memory leak in libc's disklabel
ClosedPublic

Authored by pfg on Feb 4 2015, 3:49 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Jun 9, 10:45 AM
Unknown Object (File)
Sun, Jun 9, 9:27 AM
Unknown Object (File)
Jun 2 2024, 4:14 PM
Unknown Object (File)
May 9 2024, 3:17 PM
Unknown Object (File)
Feb 24 2024, 6:24 AM
Unknown Object (File)
Feb 10 2024, 9:35 PM
Unknown Object (File)
Feb 2 2024, 10:47 PM
Unknown Object (File)
Jan 27 2024, 9:49 AM
Subscribers

Details

Reviewers
jilles
imp
Summary

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

CID: 270511
Obtained from: NetBSD (CVS rev. 1.34)

Diff Detail

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

Event Timeline

pfg retitled this revision from to Plug Memory leak in libc's disklabel.
pfg updated this object.
pfg edited the test plan for this revision. (Show Details)
pfg added a reviewer: jilles.
pfg removed a reviewer: imp.

This was mostly taken from NetBSD.
I wonder why they changed > to >=in line 148.

I added the cgetclose(); at the end: it seemed appropriate.

imp added a reviewer: imp.
imp added a subscriber: imp.

Looks good to me. Do we have other users of cgetstr in the tree with the same leak?

This revision is now accepted and ready to land.Feb 4 2015, 4:03 PM

Thank you for the review.

Yes, it's not a common call but I see another leak at:
login_getcapstr() in lib/libutil/login_cap.c

I am traversing the list of old-standing coverity issues and I am focusing on libc first though.