Danek Duvall wrote:
> On Thu, Oct 30, 2008 at 06:59:22PM -0500, Shawn Walker wrote:
> 
>> elf.c:
>>   line 286: This doesn't seem right.  Instead of returning pdict if its 
>> NULL, shouldn't you perform a Py_DECREF(pdict) and then Py_RETURN_NONE?
> 
> Why would I Py_DECREF(pdict)?  Its reference count has never been
> increased.

I was under the (mistaken?) belief that PyDict_New() created pdict with 
a reference count of 1, so Py_DECREF would be necessary for early 
garbage collection?

> I also don't want to return None, because that's not going to
> signal to Python that something went wrong.  I have to return NULL.

Argh.  Sorry, I should have realised that from the original synopsis.

>> I also noticed that the various calls to PyList_New, Py_BuildValue, 
>> Py_SetItemString, PyList_Append, etc. don't check the return value for 
>> success; in some cases, if they fail, you'll need to do a Py_DECREF.
> 
> Yes, we have more memory leaks here.  But I want to fix the core dump and
> super weird behavior that Rich is seeing first.  The rest hasn't been a
> problem so far, and can continue to be ignored for a bit.

I figured as much.

Thanks,
-- 
Shawn Walker
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to