[Python-bugs-list] [ python-Bugs-478005 ] possible memory leak in posixmodule.c

noreply@sourceforge.net noreply@sourceforge.net
Sun, 04 Nov 2001 11:07:42 -0800


Bugs item #478005, was opened at 2001-11-04 07:05
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=478005&group_id=5470

Category: Extension Modules
Group: Python 2.2
>Status: Closed
>Resolution: Rejected
Priority: 5
Submitted By: Neal Norwitz (nnorwitz)
>Assigned to: Tim Peters (tim_one)
Summary: possible memory leak in posixmodule.c

Initial Comment:
when posix_error is called a PyObject is returned,
then ignored in the caller.

it seems that this might lead to memory leaks.
this patch calls Py_DECREF(posix_error())
in all the places that previously ignored the return
value.

i'm not sure if this is correct or not.
i didn't find any problems with the regression
tests when running with this patch.

----------------------------------------------------------------------

>Comment By: Tim Peters (tim_one)
Date: 2001-11-04 11:07

Message:
Logged In: YES 
user_id=31435

Rejected for good cause <wink>.

Neal, as the comment right before posix_error() says,

/* Set a POSIX-specific error from errno, and return NULL */

Doing Py_DECREF(NULL) is almost guaranteed to cause a core 
dump, so it's hard to believe you tested any of the post-
patch changed code (nor did you claim to, but you should 
have tried to provoke at least one of the error paths 
patched).

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=478005&group_id=5470