mirror of
https://github.com/python/cpython.git
synced 2025-12-15 21:44:50 +00:00
Marc-Andre Lemburg:
Fixes a memory leak found by Fredrik Lundh.
This commit is contained in:
parent
ec5b776998
commit
8823accd1f
1 changed files with 3 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue