Bug 730989 - Memory leak in nltest.c:get_bcn()
Summary: Memory leak in nltest.c:get_bcn()
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: lldpad
Version: 6.2
Hardware: Unspecified
OS: Linux
Target Milestone: rc
: ---
Assignee: Petr Šabata
QA Contact: qe-baseos-daemons
Depends On:
Blocks: 756082
TreeView+ depends on / blocked
Reported: 2011-08-16 13:38 UTC by Petr Pisar
Modified: 2012-03-05 14:15 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2012-03-05 14:15:50 UTC

Attachments (Terms of Use)

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.

Note You need to log in before you can comment on or make changes to this bug.