Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 220094 - xendDomainCreateLinux leaks a reference count in virDomainPtr object
xendDomainCreateLinux leaks a reference count in virDomainPtr object
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: libvirt (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Daniel Veillard
Depends On:
  Show dependency treegraph
Reported: 2006-12-18 16:54 EST by Daniel Berrange
Modified: 2007-11-30 17:07 EST (History)
1 user (show)

See Also:
Fixed In Version: libvirt-0.2.3
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-06-20 15:44:53 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
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 16:54 EST, Daniel Berrange
no flags Details | Diff

  None (edit)
Description Daniel Berrange 2006-12-18 16:54:58 EST
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):

How reproducible:

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 16:54:58 EST
Created attachment 143946 [details]
Remove duplicated called to virDomainLookupByID to eliminate ref count leak
Comment 2 Daniel Veillard 2006-12-18 17:10:25 EST
Dohh, fix applied upstream, at this point,

Comment 3 Stephen Tweedie 2007-03-13 14:51:45 EDT
Is this important enough to merit being merged back to RHEL-5?
Comment 4 Daniel Veillard 2007-03-13 17:00:47 EDT
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.

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


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