Bug 220094 - xendDomainCreateLinux leaks a reference count in virDomainPtr object
Summary: xendDomainCreateLinux leaks a reference count in virDomainPtr object
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: libvirt   
(Show other bugs)
Version: 5.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Daniel Veillard
QA Contact:
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-12-18 21:54 UTC by Daniel Berrange
Modified: 2007-11-30 22:07 UTC (History)
1 user (show)

Fixed In Version: libvirt-0.2.3
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-06-20 19:44:53 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Remove duplicated called to virDomainLookupByID to eliminate ref count leak (476 bytes, patch)
2006-12-18 21:54 UTC, Daniel Berrange
no flags Details | Diff

Description Daniel Berrange 2006-12-18 21:54:58 UTC
Description of problem:
The xendDomainCreateLinux  does two calls to 

    dom = virDomainLookupByName(conn, name);

Each call to virDomainLookupByName increments the reference count on the
virDomainPtr object. So, upon returning from virDomainCreateLinux, the caller
has a virDomainPtr object with a reference count of '2' instead of the expected
'1'. The result is the virDomainPtr object will never be freed

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

How reproducible:
Always

Steps to Reproduce:
1. Run a program which calls virDomainCreateLinux under GDB
2. Stop execution immediately after virDomainCreateLinux returns
3. Examine the reference count of the returned virDomainPtr object
  
Actual results:
Ref count of 2

Expected results:
Ref count of 1

Additional info:

Comment 1 Daniel Berrange 2006-12-18 21:54:58 UTC
Created attachment 143946 [details]
Remove duplicated called to virDomainLookupByID to eliminate ref count leak

Comment 2 Daniel Veillard 2006-12-18 22:10:25 UTC
Dohh, fix applied upstream, at this point,

Daniel

Comment 3 Stephen Tweedie 2007-03-13 18:51:45 UTC
Is this important enough to merit being merged back to RHEL-5?

Comment 4 Daniel Veillard 2007-03-13 21:00:47 UTC
If we push a new libvirt this should definitely be included.
I'm not 100% this affected virt-manager as shipped, if yes
or if we push a new virt-manager, then a new libvirt should be
done in my opinion.

Daniel

Comment 5 Daniel Veillard 2007-06-20 19:44:53 UTC
Package for RHEL5 update 1 will fix this,

Daniel


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