Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8823acc

Browse files
committed
Marc-Andre Lemburg:
Fixes a memory leak found by Fredrik Lundh.
1 parent ec5b776 commit 8823acc

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Modules/_tkinter.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,8 +553,10 @@ AsObj(value)
553553
PyObject* utf8 = PyUnicode_AsUTF8String (value);
554554
if (!utf8)
555555
return 0;
556-
return Tcl_NewStringObj (PyString_AS_STRING (utf8),
556+
result = Tcl_NewStringObj (PyString_AS_STRING (utf8),
557557
PyString_GET_SIZE (utf8));
558+
Py_DECREF(utf8);
559+
return result;
558560
}
559561
else {
560562
PyObject *v = PyObject_Str(value);

0 commit comments

Comments
 (0)