[Python-checkins] r51283 - python/trunk/Objects/stringobject.c

georg.brandl python-checkins at python.org
Mon Aug 14 22:25:40 CEST 2006


Author: georg.brandl
Date: Mon Aug 14 22:25:39 2006
New Revision: 51283

Modified:
   python/trunk/Objects/stringobject.c
Log:
Fix refleak introduced in rev. 51248.



Modified: python/trunk/Objects/stringobject.c
==============================================================================
--- python/trunk/Objects/stringobject.c	(original)
+++ python/trunk/Objects/stringobject.c	Mon Aug 14 22:25:39 2006
@@ -4226,8 +4226,10 @@
 		return NULL;
 
 	buf = PyString_AsString(result);
-	if (!buf)
+	if (!buf) {
+		Py_DECREF(result);
 		return NULL;
+	}
 
 	/* To modify the string in-place, there can only be one reference. */
 	if (result->ob_refcnt != 1) {


More information about the Python-checkins mailing list