direct-io.hg

changeset 7696:e2bb85722b91

Fix two leaks in the pyxc interface. The dictionaries are being added
to lists, and an extra ref was being left behind.

Signed-off-by: Sean Perry <sean@xensource.com>
Signed-off-by: Robert Read <robert@xensource.com>
author emellor@leeni.uk.xensource.com
date Tue Nov 08 14:53:27 2005 +0100 (2005-11-08)
parents a5195bf5671d
children 7cbcdccd659d
files tools/python/xen/lowlevel/xc/xc.c
line diff
     1.1 --- a/tools/python/xen/lowlevel/xc/xc.c	Tue Nov 08 12:31:43 2005 +0100
     1.2 +++ b/tools/python/xen/lowlevel/xc/xc.c	Tue Nov 08 14:53:27 2005 +0100
     1.3 @@ -342,6 +342,7 @@ static PyObject *pyxc_domain_getinfo(PyO
     1.4                                    "ssidref",   info[i].ssidref,
     1.5                                    "shutdown_reason", info[i].shutdown_reason);
     1.6          PyDict_SetItemString(info_dict, "handle", pyhandle);
     1.7 +        Py_DECREF(pyhandle);
     1.8          PyList_SetItem(list, i, info_dict);
     1.9      }
    1.10  
    1.11 @@ -388,7 +389,7 @@ static PyObject *pyxc_vcpu_getinfo(PyObj
    1.12          cpumap >>= 1;
    1.13      }
    1.14      PyDict_SetItemString(info_dict, "cpumap", cpulist);
    1.15 -
    1.16 +    Py_DECREF(cpulist);
    1.17      return info_dict;
    1.18  }
    1.19