fix leak in memoryStats with older pythonv1.2.5
commit28386e476e5a7a6c030ccdd610b9145d6040acde
authorMartin Kletzander <mkletzan@redhat.com>
Tue, 27 May 2014 09:40:05 +0000 (27 11:40 +0200)
committerMartin Kletzander <mkletzan@redhat.com>
Tue, 27 May 2014 15:33:44 +0000 (27 17:33 +0200)
tree09bed53f762f7c4433f2e995b3e467e2004c1af1
parentbcacc418a3b21f5fe34bbe6579275453f5b849d7
fix leak in memoryStats with older python

libvirt_virDomainMemoryStats() function creates a dictionary without
any checks whether the additions were successful, whether the python
objects were created and, most importantly, without decrementing the
reference count on the objects added to the dictionary.  This is
somehow not an issue with current upstream versions, however with
python 2.6 this exposes a leak in our bindings.  The following patch
works on both old and new CPython versions and is already used in
other parts of the code, so it's also most straightforward.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1099860

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
libvirt-override.c