diff Objects/stringobject.c @ 39494:a95090281032 legacy-trunk

Fix refleak introduced in rev. 51248.
author Georg Brandl <georg@python.org>
date Mon, 14 Aug 2006 20:25:39 +0000
parents 71baa06767dd
children cfb77fff0240
line wrap: on
line diff
--- a/Objects/stringobject.c	Mon Aug 14 16:20:04 2006 +0000
+++ b/Objects/stringobject.c	Mon Aug 14 20:25:39 2006 +0000
@@ -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) {