Bug 735650

Summary: memory leak on virNetTLSContextCheckCertificate and testTLSSessionInit
Product: Red Hat Enterprise Linux 6 Reporter: Alex Jia <ajia>
Component: libvirtAssignee: Osier Yang <jyang>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: high    
Version: 6.2CC: dallan, dyuan, eblake, rwu, veillard, weizhan, xhu
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-0.9.4-11.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-06 11:28:24 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: 743047    
Attachments:
Description Flags
virnettlscontexttest-by-valgrind.log none

Description Alex Jia 2011-09-04 15:31:07 UTC
Description of problem:
There are memory leaks on the following files and functions:

* tests/virnettlscontexttest.c: static int testTLSSessionInit(const void 
  opaque)

* src/rpc/virnettlscontext.c: static int   
  virNetTLSContextValidCertificate(virNetTLSContextPtr ctxt,
                                   virNetTLSSessionPtr sess)
                                

Version-Release number of selected component (if applicable):
libvirt upstream.

How reproducible:
Always.


Steps to Reproduce:
1. cd libvirt
2. ./configure && make && make -C tests valgrind
or
./configure && make && make check tests
valgrind -v --leak-check=full ./tests/virnettlscontexttest
  
Actual results:
==22620==
==22620== LEAK SUMMARY:
==22620==    definitely lost: 90,304 bytes in 64 blocks
==22620==    indirectly lost: 342,671 bytes in 4,994 blocks
==22620==      possibly lost: 0 bytes in 0 blocks
==22620==    still reachable: 136,728 bytes in 1,449 blocks
==22620==         suppressed: 0 bytes in 0 blocks

Expected results:
Fix memory leaks.

Additional info:
please see attachment.

Comment 1 Alex Jia 2011-09-04 15:33:35 UTC
Created attachment 521379 [details]
virnettlscontexttest-by-valgrind.log

Comment 3 Alex Jia 2011-09-08 10:25:50 UTC
Patches have been pushed, Osier, you may move the bug to POST status.

commit db8ffc2dfb0c21eeb179f689252d72b17dea0b94
Author: Alex Jia <ajia>
Date:   Sun Sep 4 23:48:42 2011 +0800

    rpc: avoid memory leak on virNetTLSContextValidCertificate
    
    * src/rpc/virnettlscontext.c: fix memory leak on
      virNetTLSContextValidCertificate.
    

commit 3a89819de81661d1b2058b7bbc21e1d54ed67edf
Author: Alex Jia <ajia>
Date:   Sun Sep 4 23:48:41 2011 +0800

    tests: avoid memory leak on testTLSSessionInit
    
    * tests/virnettlscontexttest: fix memory leak on virnettlscontext test case.

Comment 8 errata-xmlrpc 2011-12-06 11:28:24 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2011-1513.html