Bug 730989

Summary: Memory leak in nltest.c:get_bcn()
Product: Red Hat Enterprise Linux 6 Reporter: Petr Pisar <ppisar>
Component: lldpadAssignee: Petr Šabata <psabata>
Status: CLOSED WONTFIX QA Contact: qe-baseos-daemons
Severity: low Docs Contact:
Priority: low    
Version: 6.2CC: azelinka, kdudka
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-03-05 14:15:50 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 756082    

Description Petr Pisar 2011-08-16 13:38:18 UTC
While reviewing fix for bug #728169 I found, or at least I think I've found, another missing free on `nlh' structure in nltest.c:get_bcn() function. So I spawning new bug report from my comment on that bug:

I can't understand the nltest.c:get_bcn() perfectly, but I suspect the `nlh'
structure is not freed at the end of the function.

Apparently a pointer to nlh space is saved as `d' that turns into `rta_parent'
and this into `rta_child'. Then the rta_child iterates over rta_parent and data
are copied from there into `bcn_data' structure in rest of the function.
Finally the function returns 0, nlh data are carried out as copy by bcn_data
argument, but the nlh itself is not not freed.

Affected version: lldpad-0.9.43-3.el6.

Comment 3 Petr Šabata 2012-03-05 14:15:50 UTC
It seems like it should be okay to free the nlh structure at the end of the function but I'm not absolutely sure.  Also, this tool isn't actually packaged and I don't like the idea of including a special patch for it.

I'll submit a patch upstream for review.