From: Gianni Tedesco Subject: Re: [PATCH 1 of 4] pyxl: Fix refcounting of Py_None Date: Fri, 10 Dec 2010 16:53:18 +0000 Message-ID: <1291999998.20366.159.camel@qabil.uk.xensource.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "xen-devel@lists.xensource.com" Cc: Ian Jackson List-Id: xen-devel@lists.xenproject.org On Thu, 2010-12-09 at 13:54 +0000, Gianni Tedesco wrote: > @@ -354,6 +356,7 @@ static PyObject *pyxl_list_domains(XlObj > goto err_mem; > memcpy(&di->obj, cur, sizeof(di->obj)); > PyList_SetItem(list, i, (PyObject *)di); > + Py_DECREF(di); > } This part is erroneous because PyList_SetItem, unlike PyList_(Insert| Append), steals a reference. Let's NAK this entire series and I'll respin a fixed a version, possibly with some other updates. Gianni