Page MenuHomeFreeBSD

Memory leaks in eui64_line()
ClosedPublic

Authored by pfg on Feb 27 2015, 2:16 AM.
Tags
None
Referenced Files
F106140415: D1976.diff
Thu, Dec 26, 1:48 AM
Unknown Object (File)
Nov 20 2024, 4:10 PM
Unknown Object (File)
Nov 13 2024, 2:08 AM
Unknown Object (File)
Oct 26 2024, 12:54 PM
Unknown Object (File)
Oct 22 2024, 10:56 AM
Unknown Object (File)
Oct 7 2024, 5:54 PM
Unknown Object (File)
Oct 1 2024, 4:23 PM
Unknown Object (File)
Sep 23 2024, 6:11 AM
Subscribers
None

Details

Reviewers
brooks
delphij
Summary

According to Coverity, there are memory leaks for cur and linehead.

The "bad" label would indicate that effectively linehead seems to need
freeing. It doesn't seem to hurt to free "cur" also.

Test Plan

IPV6

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 eui64_line() According to Coverity, there are memory leaks for cur and linehead. The "bad" label would indicate that effectively linehead seems to need freeing. It doesn't seem to hurt to free "cur" also..
pfg updated this object.
pfg edited the test plan for this revision. (Show Details)
pfg added a reviewer: delphij.
delphij requested changes to this revision.Feb 27 2015, 2:29 AM
delphij edited edge metadata.

The proposed patch is wrong. 'cur' is never leaked because it's not a new allocation.

lib/libc/net/eui64.c
135

This is WRONG. cur should not be freed because it's part of line[head].

This revision now requires changes to proceed.Feb 27 2015, 2:29 AM
pfg edited edge metadata.
pfg retitled this revision from Memory leaks in eui64_line() According to Coverity, there are memory leaks for cur and linehead. The "bad" label would indicate that effectively linehead seems to need freeing. It doesn't seem to hurt to free "cur" also. to Memory leaks in eui64_line().
pfg updated this object.

Makes sense: the normal return free() matches the bad label now.

Thanks!

delphij edited edge metadata.
This revision is now accepted and ready to land.Feb 27 2015, 3:14 AM
brooks edited edge metadata.

Looks good to me.

Thank you for reviewing!

Committed as revision 279363.