Bug 1116427 - Memory leak in virConnectOpenAuth
Summary: Memory leak in virConnectOpenAuth
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libvirt
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Ján Tomko
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-07-04 14:41 UTC by Richard W.M. Jones
Modified: 2014-07-07 06:51 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2014-07-07 06:51:07 UTC
Embargoed:


Attachments (Terms of Use)

Description Richard W.M. Jones 2014-07-04 14:41:03 UTC
Description of problem:

As revealed by valgrind:

==25515== 19 bytes in 1 blocks are definitely lost in loss record 59 of 318
==25515==    at 0x4A0645D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==25515==    by 0x30C590654F: __vasprintf_chk (vasprintf_chk.c:80)
==25515==    by 0x4FEDC25: virVasprintfInternal (stdio2.h:210)
==25515==    by 0x4FEDD0B: virAsprintfInternal (virstring.c:482)
==25515==    by 0x4FBCDF5: virFileFindResourceFull (virfile.c:1598)
==25515==    by 0x50D2521: doRemoteOpen (remote_driver.c:867)
==25515==    by 0x50D3A75: remoteConnectOpen (remote_driver.c:1199)
==25515==    by 0x5075D87: do_open (libvirt.c:1147)
==25515==    by 0x507834F: virConnectOpenAuth (libvirt.c:1390)
==25515==    by 0x4CBAD04: guestfs___open_libvirt_connection (libvirt-auth.c:227)
==25515==    by 0x4CB869F: launch_libvirt (launch-libvirt.c:275)
==25515==    by 0x4CB0E16: guestfs__launch (launch.c:93)

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

libvirt-1.2.6-1.fc21.x86_64

How reproducible:

100%

Steps to Reproduce:
1. Run virt-sysprep under valgrind.

Comment 1 Ján Tomko 2014-07-07 06:34:35 UTC
Patch posted:
https://www.redhat.com/archives/libvir-list/2014-July/msg00286.html

Comment 2 Ján Tomko 2014-07-07 06:51:07 UTC
commit f1e192e92ec17f9fe979f1d30bad79f21189eef1
Author:     Ján Tomko <jtomko>
CommitDate: 2014-07-07 08:32:11 +0200

    Free the return value of virFileFindResource
    
    Commits e18a80a and 57e5c3c switched from a getenv wrapper which
    does not allocate a string to virFileFindResource which does not,
    without freeing it.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1116427

git describe: v1.2.6-50-gf1e192e


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