diff --git a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/xc/xc.c index f7a00037e9..e2585dc5ed 100644 --- a/tools/python/xen/lowlevel/xc/xc.c +++ b/tools/python/xen/lowlevel/xc/xc.c @@ -342,6 +342,7 @@ static PyObject *pyxc_domain_getinfo(PyObject *self, "ssidref", info[i].ssidref, "shutdown_reason", info[i].shutdown_reason); PyDict_SetItemString(info_dict, "handle", pyhandle); + Py_DECREF(pyhandle); PyList_SetItem(list, i, info_dict); } @@ -388,7 +389,7 @@ static PyObject *pyxc_vcpu_getinfo(PyObject *self, cpumap >>= 1; } PyDict_SetItemString(info_dict, "cpumap", cpulist); - + Py_DECREF(cpulist); return info_dict; }