[Python-bugs-list] [ python-Bugs-416288 ] infrequent memory leak in pyexpat

noreply@sourceforge.net noreply@sourceforge.net
Thu, 28 Mar 2002 14:34:26 -0800


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

Category: XML
Group: None
Status: Open
Resolution: None
Priority: 2
Submitted By: douglas orr (dougbo)
Assigned to: Martin v. Löwis (loewis)
Summary: infrequent memory leak in pyexpat

Initial Comment:
In pyexpat.c, the macro call for the handler dispatch 
(my##NAME##Handler) for CharacterHandler allocates an 
object implicitly by calling one of the conversion-to-
unicode routines.  

If there is a problem in the PyBuildValue, resulting 
in args == NULL, that object will be leaked.

Low priority, but the macros probably need some 
reworking to handle this.

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

>Comment By: Guido van Rossum (gvanrossum)
Date: 2002-03-28 17:34

Message:
Logged In: YES 
user_id=6380

Hm, the 'N' format code looks really scary. Can't it end up
DECREF'ing an object too many times if something fails?

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

Comment By: Martin v. Löwis (loewis)
Date: 2001-06-09 07:48

Message:
Logged In: YES 
user_id=21627

That seems to be a bug in Py_BuildValue: It should decref 
its N arguments if it can't create a tuple.



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

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