Commit bdd3567c authored by Victor Stinner's avatar Victor Stinner Committed by GitHub

_tkinter: Fix refleak in getint() (#2153)

PyNumber_Int() creates a new reference: need to decrement result
reference counter.
parent 15a6127e
......@@ -2131,8 +2131,12 @@ Tkapp_GetInt(PyObject *self, PyObject *args)
result = fromWideIntObj(self, value);
#endif
Tcl_DecrRefCount(value);
if (result != NULL)
return PyNumber_Int(result);
if (result != NULL) {
PyObject *resint = PyNumber_Int(result);
Py_DECREF(result);
return resint;
}
if (PyErr_Occurred())
return NULL;
#else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment