diff -r 0e3910f1de64 tools/python/xen/lowlevel/xc/xc.c --- a/tools/python/xen/lowlevel/xc/xc.c Tue Jan 12 07:17:40 2010 +0000 +++ b/tools/python/xen/lowlevel/xc/xc.c Tue Jan 12 17:28:55 2010 +0100 @@ -1129,20 +1129,23 @@ Py_DECREF(pyint); node_exists = 1; } - PyList_Append(node_to_cpu_obj, cpus); + if (node_exists) + PyList_Append(node_to_cpu_obj, cpus); Py_DECREF(cpus); /* Memory. */ xc_availheap(self->xc_handle, 0, 0, i, &free_heap); node_exists = node_exists || (free_heap != 0); pyint = PyInt_FromLong(free_heap / 1024); - PyList_Append(node_to_memory_obj, pyint); + if (node_exists) + PyList_Append(node_to_memory_obj, pyint); Py_DECREF(pyint); /* DMA memory. */ xc_availheap(self->xc_handle, 0, 32, i, &free_heap); pyint = PyInt_FromLong(free_heap / 1024); - PyList_Append(node_to_dma32_mem_obj, pyint); + if (node_exists) + PyList_Append(node_to_dma32_mem_obj, pyint); Py_DECREF(pyint); if ( node_exists )