[Patches] [ python-Patches-475033 ] Fix for defect #474538

noreply@sourceforge.net noreply@sourceforge.net
Thu, 25 Oct 2001 13:44:02 -0700


Patches item #475033, was opened at 2001-10-25 12:50
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=475033&group_id=5470

Category: Core (C code)
Group: None
Status: Closed
Resolution: Fixed
Priority: 5
Submitted By: Dave Brueck (dbrueck)
Assigned to: Guido van Rossum (gvanrossum)
Summary: Fix for defect #474538

Initial Comment:
Defect #474538 just needs two Py_DECREF calls, this is a patch that supplies them for selectmodule.c (CVS version 2.57).

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

>Comment By: Dave Brueck (dbrueck)
Date: 2001-10-25 13:44

Message:
Logged In: YES 
user_id=148729

Thanks so much!

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

Comment By: Guido van Rossum (gvanrossum)
Date: 2001-10-25 13:20

Message:
Logged In: YES 
user_id=6380

Thanks. I've fixed it a bit differently (if the 2nd
PyInt_FromLong() call ever failed, it would still leak :-).

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

Comment By: Dave Brueck (dbrueck)
Date: 2001-10-25 12:52

Message:
Logged In: YES 
user_id=148729

My browser hates me. Here is the patch; I'll try uploading it again:

--- selectmodule.c,2.57	Thu Oct 25 13:41:25 2001
+++ selectmodule.c	Thu Oct 25 13:42:01 2001
@@ -381,6 +381,9 @@
 	     (PyDict_SetItem(self->dict, key, value)) == -1) {
 		return NULL;
 	}
+
+	Py_DECREF(key);
+	Py_DECREF(value);
 	self->ufd_uptodate = 0;
 		       
 	Py_INCREF(Py_None);


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

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