Bug 540521 - netcf_close is not free'ing the netlink handle
Summary: netcf_close is not free'ing the netlink handle
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: netcf
Version: 12
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: David Lutterkort
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 540330
TreeView+ depends on / blocked
 
Reported: 2009-11-23 15:13 UTC by Daniel Berrangé
Modified: 2013-04-30 23:41 UTC (History)
2 users (show)

Fixed In Version: 0.1.5-1.fc12
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-12-18 04:33:22 UTC
Type: ---


Attachments (Terms of Use)
Fix free'ing of netlink handle (454 bytes, patch)
2009-11-23 15:14 UTC, Daniel Berrangé
no flags Details | Diff

Description Daniel Berrangé 2009-11-23 15:13:51 UTC
Description of problem:
valgrind is showing a memory leak from  the netlink_init() callpath. Looking at the corresponding netlink-close() method in netcf, it appears it is merely closing the socket, and not free'ing the memory for the libnl handle.

Version-Release number of selected component (if applicable):
0.1.4

How reproducible:
Always

Steps to Reproduce:
1. Run this test program under valgrind

#include <netcf.h>
#include <stdio.h>

int main(int argc, char **argv)
{
    for (int i = 0 ; i < 1000000 ; i++) {
        struct netcf *netcf = NULL;

        ncf_init(&netcf, NULL);

        if (netcf != NULL) {
            ncf_close(netcf);
        }
    }
    return 0;
}


2. Compile and run that as root
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Daniel Berrangé 2009-11-23 15:14:44 UTC
Created attachment 373139 [details]
Fix free'ing of netlink handle

Comment 2 David Lutterkort 2009-11-23 19:00:01 UTC
Cool - saves me from firing up valgrind. Patch committed upstream.

Comment 3 Fedora Update System 2009-12-02 04:26:33 UTC
netcf-0.1.5-1.fc12 has been pushed to the Fedora 12 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update netcf'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F12/FEDORA-2009-12472

Comment 4 Fedora Update System 2009-12-18 04:33:12 UTC
netcf-0.1.5-1.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.


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