[Python-3000-checkins] r56894 - python/branches/py3k/Objects/unicodeobject.c

walter.doerwald python-3000-checkins at python.org
Fri Aug 10 12:11:44 CEST 2007


Author: walter.doerwald
Date: Fri Aug 10 12:11:43 2007
New Revision: 56894

Modified:
   python/branches/py3k/Objects/unicodeobject.c
Log:
Fix refleak: decref inputobj after extracting the relavant info (the object
won't go away, as the exception object holds another reference).


Modified: python/branches/py3k/Objects/unicodeobject.c
==============================================================================
--- python/branches/py3k/Objects/unicodeobject.c	(original)
+++ python/branches/py3k/Objects/unicodeobject.c	Fri Aug 10 12:11:43 2007
@@ -1323,6 +1323,9 @@
     *input = PyBytes_AS_STRING(inputobj);
     insize = PyBytes_GET_SIZE(inputobj);
     *inend = *input + insize;
+    /* we can DECREF safely, as the exception has another reference,
+       so the object won't go away. */
+    Py_DECREF(inputobj);
 
     if (newpos<0)
 	newpos = insize+newpos;


More information about the Python-3000-checkins mailing list