From 8823accd1f3052014989670edee7002d29fba293 Mon Sep 17 00:00:00 2001
From: Guido van Rossum <guido@python.org>
Date: Thu, 27 Apr 2000 20:14:31 +0000
Subject: [PATCH] Marc-Andre Lemburg:

Fixes a memory leak found by Fredrik Lundh.
---
 Modules/_tkinter.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c
index 601a70c56e..008378dff4 100644
--- a/Modules/_tkinter.c
+++ b/Modules/_tkinter.c
@@ -553,8 +553,10 @@ AsObj(value)
 		PyObject* utf8 = PyUnicode_AsUTF8String (value);
 		if (!utf8)
 			return 0;
-		return Tcl_NewStringObj (PyString_AS_STRING (utf8),
+		result = Tcl_NewStringObj (PyString_AS_STRING (utf8),
 					 PyString_GET_SIZE (utf8));
+		Py_DECREF(utf8);
+		return result;
 	}
 	else {
 		PyObject *v = PyObject_Str(value);
-- 
2.40.0