[Python-bugs-list] [Bug #119862] Memory leak in python 2.0 and below

noreply@sourceforge.net noreply@sourceforge.net
Mon, 11 Dec 2000 12:01:35 -0800


Bug #119862, was updated on 2000-Oct-31 04:22
Here is a current snapshot of the bug.

Project: Python
Category: Core
Status: Closed
Resolution: Fixed
Bug Group: None
Priority: 5
Submitted by: nobody
Assigned to : bwarsaw
Summary: Memory leak in python 2.0 and below

Details: The reference count of the item returned by the PyMapping_GetItemString function in call inside the function vgetargskeywords is not decremented. This can result in a memory leak.

Follow-Ups:

Date: 2000-Dec-11 12:01
By: bwarsaw

Comment:
Patch approved by Guido and checked in, getargs.c 2.51.

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

Date: 2000-Dec-11 11:37
By: bwarsaw

Comment:
Here's a proposed patch.

Index: getargs.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/getargs.c,v
retrieving revision 2.50
diff -u -r2.50 getargs.c
--- getargs.c	2000/12/01 12:59:05	2.50
+++ getargs.c	2000/12/11 19:36:34
@@ -1123,6 +1123,7 @@
 				return 0;
 			}
 			converted++;
+			Py_DECREF(item);
 		}
 		else {
 			PyErr_Clear();

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

Date: 2000-Dec-11 10:40
By: bwarsaw

Comment:
Here's a program that should trigger the leak in Python 2.0.
I'm investigating further.

----- snip snip -----
import sha
sha.new(string='hello')
----- snip snip -----

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

For detailed info, follow this link:
http://sourceforge.net/bugs/?func=detailbug&bug_id=119862&group_id=5470