Bug 540521 - netcf_close is not free'ing the netlink handle
netcf_close is not free'ing the netlink handle
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: netcf (Show other bugs)
12
All Linux
low Severity medium
: ---
: ---
Assigned To: David Lutterkort
Fedora Extras Quality Assurance
:
Depends On:
Blocks: 540330
  Show dependency treegraph
 
Reported: 2009-11-23 10:13 EST by Daniel Berrange
Modified: 2013-04-30 19:41 EDT (History)
2 users (show)

See Also:
Fixed In Version: 0.1.5-1.fc12
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-12-17 23:33:22 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


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

  None (edit)
Description Daniel Berrange 2009-11-23 10:13:51 EST
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 Berrange 2009-11-23 10:14:44 EST
Created attachment 373139 [details]
Fix free'ing of netlink handle
Comment 2 David Lutterkort 2009-11-23 14:00:01 EST
Cool - saves me from firing up valgrind. Patch committed upstream.
Comment 3 Fedora Update System 2009-12-01 23:26:33 EST
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-17 23:33:12 EST
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.