summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2000-04-27 20:14:31 (GMT)
committerGuido van Rossum <guido@python.org>2000-04-27 20:14:31 (GMT)
commit8823accd1f3052014989670edee7002d29fba293 (patch)
tree334547358cb55bbf1e11cb00c8cd2e2111155fc7 /Modules
parentec5b776998481c4b8e2ebfe2bbf0b76d5fa95a6b (diff)
downloadcpython-8823accd1f3052014989670edee7002d29fba293.zip
cpython-8823accd1f3052014989670edee7002d29fba293.tar.gz
cpython-8823accd1f3052014989670edee7002d29fba293.tar.bz2
Marc-Andre Lemburg:
Fixes a memory leak found by Fredrik Lundh.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_tkinter.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c
index 601a70c..008378d 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);